7195_roadmap2 #2554
|
@ -1,12 +1,12 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('getPalletMatchState', {
|
||||
description: 'Get list of pallet from roadMapStop with true or false if state is matched',
|
||||
description: 'Get list of pallet from truckFk with true or false if state is matched',
|
||||
sergiodt marked this conversation as resolved
Outdated
|
||||
accessType: 'WRITE',
|
||||
accepts: [{
|
||||
arg: 'roadMapStopFk',
|
||||
arg: 'truckFk',
|
||||
type: 'number',
|
||||
required: true,
|
||||
description: 'The roadmapFk id'
|
||||
description: 'The truckFk id'
|
||||
},
|
||||
{
|
||||
arg: 'state',
|
||||
|
@ -24,7 +24,7 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.getPalletMatchState = async(roadMapStopFk, state, options) => {
|
||||
Self.getPalletMatchState = async(truckFk, state, options) => {
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
|
@ -54,7 +54,7 @@ module.exports = Self => {
|
|||
LEFT JOIN totalPalletExpedition tpe ON tpe.expedition = t.expedition
|
||||
LEFT JOIN totalPalletExpeditionCode tpec ON tpec.expedition = t.expedition
|
||||
GROUP BY t.pallet;`,
|
||||
[roadMapStopFk, state],
|
||||
[truckFk, state],
|
||||
myOptions);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -3,9 +3,9 @@ const {models} = require('vn-loopback/server/server');
|
|||
|
||||
describe('roadMapStop getPalletMatchState()', () => {
|
||||
it('should return list of pallet with true or false if state is matched', async() => {
|
||||
sergiodt marked this conversation as resolved
Outdated
jgallego
commented
fit no fit no
sergiodt
commented
Llevat Llevat
|
||||
const roadmapStopFk = 1;
|
||||
const truckFk = 1;
|
||||
const state = 'ON DELIVERY';
|
||||
const result = await models.RoadmapStop.getPalletMatchState(roadmapStopFk, state);
|
||||
const result = await models.RoadmapStop.getPalletMatchState(truckFk, state);
|
||||
|
||||
expect(result[0].hasMatchStateCode).toBe(1);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
posa algo mes concret del que fa el proc
Afegit