salix/modules/agency/back/methods/agency/getFirstShipped.js

28 lines
784 B
JavaScript
Raw Normal View History

module.exports = Self => {
Self.remoteMethod('getFirstShipped', {
description: 'Returns the first shipped and landed possible for params',
accessType: '',
accepts: [{
arg: 'params',
type: 'object',
required: true,
description: 'agencyModeFk, addressFk, warehouseFk'
}],
returns: {
type: 'object',
root: true
},
http: {
path: `/getFirstShipped`,
verb: 'get'
}
});
Self.getFirstShipped = async params => {
2019-03-13 15:09:00 +00:00
let query = `CALL vn.zoneGetFirstShipped(?, ?, ?)`;
let [result] = await Self.rawSql(query, [params.agencyModeFk, params.addressFk, params.warehouseFk]);
return result[0];
};
};