refs #5890:feat:ItemShelvingSale
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
1a2b58af9c
commit
ca4086d115
|
@ -0,0 +1,20 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_reserveBySale`(
|
||||
vSaleFk INT ,
|
||||
vUserFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Reserva cantida y ubicación para una saleFk
|
||||
*
|
||||
* @param vSaleFk Identificador de la venta
|
||||
* @param vQuantity Cantidad a reservar
|
||||
* @param vUserFk Id de usuario que realiza la reserva
|
||||
*/
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
|
||||
ENGINE = MEMORY
|
||||
SELECT vSaleFk saleFk, vUserFk userFk;
|
||||
|
||||
CALL itemShelvingSale_reserve();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,28 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('itemShelvingSaleBySale', {
|
||||
description: 'Insert sale in itemShelvingSale',
|
||||
accessType: 'WRITE',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'id',
|
||||
type: 'number',
|
||||
description: 'The sale id',
|
||||
required: true,
|
||||
http: { source: 'path' }
|
||||
}
|
||||
],
|
||||
http: {
|
||||
path: `/:id/itemShelvingSaleBySale`,
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
Self.itemShelvingSaleBySale = async (ctx, id, options) => {
|
||||
const myOptions = { userId: ctx.req.accessToken.userId };
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
await Self.rawSql(`CALL vn.itemShelvingSale_reserveBySale(?)`, [id], myOptions);
|
||||
};
|
||||
};
|
|
@ -1,5 +1,6 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/item-shelving-sale/filter')(Self);
|
||||
require('../methods/item-shelving-sale/itemShelvingSaleByCollection')(Self);
|
||||
require('../methods/item-shelving-sale/itemShelvingSaleBySale')(Self);
|
||||
require('../methods/item-shelving-sale/itemShelvingSaleSetQuantity')(Self);
|
||||
};
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"isPicked": {
|
||||
"type": "Boolean"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
Loading…
Reference in New Issue