2023-09-27 12:01:17 +00:00
|
|
|
module.exports = Self => {
|
|
|
|
Self.remoteMethod('itemShelvingSaleByCollection', {
|
|
|
|
description: 'Insert sales of the collection in itemShelvingSale',
|
|
|
|
accessType: 'WRITE',
|
|
|
|
accepts: [
|
|
|
|
{
|
|
|
|
arg: 'id',
|
2023-09-28 06:08:40 +00:00
|
|
|
type: 'number',
|
2023-09-27 12:01:17 +00:00
|
|
|
description: 'The collection id',
|
2023-09-28 06:08:40 +00:00
|
|
|
required: true,
|
2023-09-27 12:01:17 +00:00
|
|
|
http: {source: 'path'}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
http: {
|
|
|
|
path: `/:id/itemShelvingSaleByCollection`,
|
|
|
|
verb: 'POST'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Self.itemShelvingSaleByCollection = async id => {
|
|
|
|
await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id]);
|
|
|
|
};
|
|
|
|
};
|