WIP: Allocate landed cost.

This commit is contained in:
a.bouhuolia
2021-07-22 18:11:17 +02:00
parent 1eacc254d8
commit 76c6cb3699
33 changed files with 1577 additions and 163 deletions

View File

@@ -0,0 +1,36 @@
import { Model } from 'objection';
import TenantModel from 'models/TenantModel';
export default class BillLandedCost extends TenantModel {
/**
* Table name
*/
static get tableName() {
return 'bill_located_costs';
}
/**
* Model timestamps.
*/
get timestamps() {
return ['createdAt', 'updatedAt'];
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const BillLandedCostEntry = require('models/BillLandedCostEntry');
return {
allocateEntries: {
relation: Model.HasManyRelation,
modelClass: BillLandedCostEntry.default,
join: {
from: 'bill_located_costs.id',
to: 'bill_located_cost_entries.billLocatedCostId',
},
},
};
}
}