feat: Re-compute the given items cost job.

feat: Optimize the architecture.
This commit is contained in:
Ahmed Bouhuolia
2020-08-18 02:28:08 +02:00
parent 4e68a7db71
commit d423365a19
44 changed files with 1605 additions and 798 deletions

View File

@@ -0,0 +1,36 @@
import { Model } from 'objection';
import TenantModel from '@/models/TenantModel';
export default class InventoryCostLotTracker extends TenantModel {
/**
* Table name
*/
static get tableName() {
return 'inventory_cost_lot_tracker';
}
/**
* Model timestamps.
*/
static get timestamps() {
return [];
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const Item = require('@/models/Item');
return {
item: {
relation: Model.BelongsToOneRelation,
modelClass: this.relationBindKnex(Item.default),
join: {
from: 'inventory_cost_lot_tracker.itemId',
to: 'items.id',
},
},
};
}
}