fix: refs #6276 item_card & wip test
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
19edd7868e
commit
b33594e0da
|
@ -30,14 +30,13 @@ module.exports = Self => {
|
||||||
const [result] = await Self.rawSql('CALL vn.item_getInfo(?, ?)', [itemFk, warehouseFk]);
|
const [result] = await Self.rawSql('CALL vn.item_getInfo(?, ?)', [itemFk, warehouseFk]);
|
||||||
|
|
||||||
const barcodeItems = await Self.rawSql('SELECT vn.barcodeToItem(?) as realIdItem', [itemFk]);
|
const barcodeItems = await Self.rawSql('SELECT vn.barcodeToItem(?) as realIdItem', [itemFk]);
|
||||||
const realIdItems = barcodeItems.map(barcodeItem => barcodeItem.realIdItem);
|
const [realIdItem] = barcodeItems.map(barcodeItem => barcodeItem.realIdItem);
|
||||||
|
|
||||||
const barcodes = await models.ItemBarcode.find({
|
const barcodes = await models.ItemBarcode.find({
|
||||||
fields: ['code'],
|
fields: ['code'],
|
||||||
where: {
|
where: {
|
||||||
realIdItem: {
|
itemFk: realIdItem
|
||||||
inq: realIdItems
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
|
fdescribe('item card()', () => {
|
||||||
|
const itemFk = 1;
|
||||||
|
const warehouseFk = 1;
|
||||||
|
it('WIP: should get something', async() => {
|
||||||
|
const card = await models.Item.card(itemFk, warehouseFk);
|
||||||
|
|
||||||
|
expect(card).toBeDefined();
|
||||||
|
expect(card.barcodes);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue