#6964 _ itemOlder #2197

Merged
sergiodt merged 26 commits from 6964_itemOlder into dev 2024-04-04 14:18:20 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit a40234ba9b - Show all commits

View File

@ -53,7 +53,7 @@ module.exports = Self => {
AND (p.code <> ? OR ? IS NULL)
AND (ish.shelvingFk <> ? OR ? IS NULL)
sergiodt marked this conversation as resolved Outdated
Outdated
Review

falta gastar la transaccio (...shelvingFkOut, itemFk, itemFk], options)

falta gastar la transaccio (...shelvingFkOut, itemFk, itemFk], options)

Llevat options

Llevat options
Outdated
Review

Es ficarlo sino no gastarà la transaccio

Es ficarlo sino no gastarà la transaccio

L'he posat però no veia que fera falta...

L'he posat però no veia que fera falta...
AND (ish.itemFk <> ? OR ? IS NULL)`,
sergiodt marked this conversation as resolved Outdated
Outdated
Review

Si li poses el alias aci hi ha que canviarlo

Si li poses el alias aci hi ha que canviarlo
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk]);
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk], options);
sergiodt marked this conversation as resolved Outdated
Outdated
Review

Aci

Aci
Outdated
Review

myOptions

myOptions
return result[0]['countItemOlder'] > 0;
};
};

View File

@ -5,7 +5,7 @@ describe('itemShelving hasOlder()', () => {
it('should return false because there are not older items', async() => {
const shelvingFkIn = 'GVC';
const shelvingFkOut = 'HEJ';
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, shelvingFkOut);
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut);
sergiodt marked this conversation as resolved Outdated
Outdated
Review

Al cridar a la funcio hi ha que seguir el mateix ordre que dalt (async(shelvingFkIn, parking, shelvingFkOut, itemFk, options)

Per tant seria await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut)

Al cridar a la funcio hi ha que seguir el mateix ordre que dalt (`async(shelvingFkIn, parking, shelvingFkOut, itemFk, options`) Per tant seria `await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut)`
expect(result).toBe(false);
});
@ -33,7 +33,7 @@ describe('itemShelving hasOlder()', () => {
await itemShelvingBefore.updateAttributes({
itemFk: itemFk
sergiodt marked this conversation as resolved
Review

, myOptions

, myOptions
});
sergiodt marked this conversation as resolved Outdated
Outdated
Review

, myOptions

, myOptions
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking);
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions);
sergiodt marked this conversation as resolved Outdated
Outdated
Review

Aci deuries gastar la transaccio
await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions)

Aci deuries gastar la transaccio await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions)

Ací si que veig que faltava posar myOptions perquè faig més accions

Ací si que veig que faltava posar myOptions perquè faig més accions
expect(result).toBe(true);
await tx.rollback();