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

@@ -32,4 +32,19 @@ export default class ItemEntry extends TenantModel {
return discount ? total - (total * discount * 0.01) : total;
}
static get relationMappings() {
const Item = require('@/models/Item');
return {
item: {
relation: Model.BelongsToOneRelation,
modelClass: this.relationBindKnex(Item.default),
join: {
from: 'items_entries.itemId',
to: 'items.id',
},
},
};
}
}