28 lines
784 B
JavaScript
28 lines
784 B
JavaScript
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 => {
|
|
let query = `CALL vn.zoneGetFirstShipped(?, ?, ?)`;
|
|
let [result] = await Self.rawSql(query, [params.agencyModeFk, params.addressFk, params.warehouseFk]);
|
|
|
|
return result[0];
|
|
};
|
|
};
|