7195_roadmap2 #2554

Merged
sergiodt merged 12 commits from 7195_roadmap2 into dev 2024-07-03 06:56:50 +00:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit e1b6ba4276 - Show all commits

View File

@ -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

posa algo mes concret del que fa el proc

posa algo mes concret del que fa el proc

Afegit

Afegit
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;

View File

@ -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

fit no

fit no

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);
});