salix/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

module.exports = Self => {
Self.remoteMethod('itemShelvingSaleSetQuantity', {
description: 'Set quanitity of a sale in itemShelvingSale',
accessType: 'WRITE',
accepts: [
{
arg: 'id',
2023-09-28 06:08:40 +00:00
type: 'number',
required: true,
description: 'The sale id',
},
{
arg: 'quantity',
2023-09-28 06:08:40 +00:00
type: 'number',
required: true,
description: 'The quantity to set',
},
{
arg: 'isItemShelvingSaleEmpty',
2023-09-28 06:08:40 +00:00
type: 'boolean',
required: true,
description: 'True if the shelvingFk is empty ',
}
],
http: {
path: `/itemShelvingSaleSetQuantity`,
verb: 'POST'
}
});
Self.itemShelvingSaleSetQuantity = async(id, quantity, isItemShelvingSaleEmpty) => {
await Self.rawSql(`CALL vn.itemShelvingSale_setQuantity(?, ?, ? )`, [id, quantity, isItemShelvingSaleEmpty]);
};
};