added missing method getAgenciesWithWarehouse
This commit is contained in:
parent
ce0d80f019
commit
81ef984597
|
@ -0,0 +1,27 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('getAgenciesWithWarehouse', {
|
||||
description: 'Returns a list of agencies that can land a shipment on a day for an address and a warehouse',
|
||||
accessType: '',
|
||||
accepts: [{
|
||||
arg: 'filter',
|
||||
type: 'object',
|
||||
required: true,
|
||||
description: 'addressFk'
|
||||
}],
|
||||
returns: {
|
||||
type: 'object',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/getAgenciesWithWarehouse`,
|
||||
verb: 'get'
|
||||
}
|
||||
});
|
||||
|
||||
Self.getAgenciesWithWarehouse = async filter => {
|
||||
let query = `CALL vn.agencyHourGetWarehouse(?, ?, ?)`;
|
||||
let result = await Self.rawSql(query, [filter.addressFk, filter.landed, filter.warehouseFk]);
|
||||
|
||||
return result;
|
||||
};
|
||||
};
|
|
@ -1,4 +1,5 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/agency/landsThatDay')(Self);
|
||||
require('../methods/agency/getFirstShipped')(Self);
|
||||
require('../methods/agency/getAgenciesWithWarehouse')(Self);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue