Merge pull request '6964_itemNewer' (!2682) from 6964_itemNewer into master
Reviewed-on: #2682 Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
commit
41fab962d9
|
@ -63,7 +63,7 @@ module.exports = Self => {
|
|||
FROM tItemShelving ti
|
||||
JOIN tItemInSector tis ON tis.itemFk = ti.itemFk
|
||||
JOIN vn.productionConfig pc
|
||||
WHERE ti.created > tis.created + INTERVAL pc.itemOlderReviewHours HOUR;`,
|
||||
WHERE ti.created + INTERVAL pc.itemOlderReviewHours HOUR < tis.created ;`,
|
||||
[shelvingFk, shelvingFk], myOptions);
|
||||
return result;
|
||||
};
|
||||
|
|
|
@ -3,29 +3,16 @@ const {models} = require('vn-loopback/server/server');
|
|||
|
||||
describe('itemShelving getListItemNewer()', () => {
|
||||
it('should return true because there is an older item', async() => {
|
||||
const shelving = 'NCC';
|
||||
const parking = 'A-47-1';
|
||||
const shelving = 'NBB';
|
||||
const parking = '700-01';
|
||||
|
||||
const sectorCamHighCode = 'CAMARA SECTOR D';
|
||||
const sectorCamCode = 'NAVE ALGEMESI';
|
||||
|
||||
const sectorCamCodeHighId = 1;
|
||||
const sectorCamCodeId = 9991;
|
||||
const sectorCamHighCode = 'FIRST';
|
||||
const sectorCamCode = 'NS';
|
||||
|
||||
const tx = await models.Sector.beginTransaction({});
|
||||
const myOptions = {transaction: tx};
|
||||
|
||||
try {
|
||||
const sectorHighCam = await models.Sector.findById(sectorCamCodeHighId, null, myOptions);
|
||||
await sectorHighCam.updateAttributes({
|
||||
code: sectorCamHighCode
|
||||
});
|
||||
|
||||
const sectorCam = await models.Sector.findById(sectorCamCodeId, null, myOptions);
|
||||
await sectorCam.updateAttributes({
|
||||
code: sectorCamCode
|
||||
});
|
||||
|
||||
const config = await models.ProductionConfig.findOne();
|
||||
|
||||
await config.updateAttributes({
|
||||
|
@ -35,7 +22,7 @@ describe('itemShelving getListItemNewer()', () => {
|
|||
|
||||
const result = await models.ItemShelving.getListItemNewer(shelving, parking, myOptions);
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
expect(result.length).toEqual(3);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
|
|
Loading…
Reference in New Issue