faults
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a4f14e5fda
commit
c7a5d94ed0
|
@ -0,0 +1,35 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('collectionFaults', {
|
||||||
|
description: 'Update sale of a collection',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'shelvingFk',
|
||||||
|
type: 'Number',
|
||||||
|
required: true,
|
||||||
|
description: 'The sale id'
|
||||||
|
}, {
|
||||||
|
arg: 'quantity',
|
||||||
|
type: 'Number',
|
||||||
|
required: true,
|
||||||
|
description: 'The quantity to sale'
|
||||||
|
}, {
|
||||||
|
arg: 'itemFk',
|
||||||
|
type: 'Number',
|
||||||
|
required: true,
|
||||||
|
description: 'The ticket id'
|
||||||
|
}],
|
||||||
|
returns: {
|
||||||
|
type: 'Object',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/collectionFaults`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.collectionFaults = async(ctx, shelvingFk, quantity, itemFk) => {
|
||||||
|
query = `vn.collection_faults(?,?,?)`;
|
||||||
|
return await Self.rawSql(query, [shelvingFk, quantity, itemFk]);
|
||||||
|
};
|
||||||
|
};
|
|
@ -45,6 +45,9 @@ module.exports = Self => {
|
||||||
query = `CALL vn.collectionPlacement_get(?)`;
|
query = `CALL vn.collectionPlacement_get(?)`;
|
||||||
const [placements] = await Self.rawSql(query, [collectionFk]);
|
const [placements] = await Self.rawSql(query, [collectionFk]);
|
||||||
|
|
||||||
|
query = `CALL vn.collectionSticker_print(?,?)`;
|
||||||
|
// await Self.rawSql(query, [collectionFk, sectorFk]);
|
||||||
|
|
||||||
return makeCollection(tickets, sales, placements);
|
return makeCollection(tickets, sales, placements);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,5 @@ module.exports = Self => {
|
||||||
require('../methods/collection/collectionNew')(Self);
|
require('../methods/collection/collectionNew')(Self);
|
||||||
require('../methods/collection/getSectors')(Self);
|
require('../methods/collection/getSectors')(Self);
|
||||||
require('../methods/collection/collectionUpdateSale')(Self);
|
require('../methods/collection/collectionUpdateSale')(Self);
|
||||||
|
require('../methods/collection/collectionFaults')(Self);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue