feat: Concurrency control items cost compute.

This commit is contained in:
Ahmed Bouhuolia
2020-08-23 23:38:42 +02:00
parent 45088b2d3b
commit ab6bc0517f
28 changed files with 463 additions and 341 deletions

View File

@@ -58,4 +58,24 @@ export default class HasItemEntries {
});
return Promise.all([...opers]);
}
static filterNonInventoryEntries(entries: [], items: []) {
const nonInventoryItems = items.filter((item: any) => item.type !== 'inventory');
const nonInventoryItemsIds = nonInventoryItems.map((i: any) => i.id);
return entries
.filter((entry: any) => (
(nonInventoryItemsIds.indexOf(entry.item_id)) !== -1
));
}
static filterInventoryEntries(entries: [], items: []) {
const inventoryItems = items.filter((item: any) => item.type === 'inventory');
const inventoryItemsIds = inventoryItems.map((i: any) => i.id);
return entries
.filter((entry: any) => (
(inventoryItemsIds.indexOf(entry.item_id)) !== -1
));
}
}