mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 20:00:33 +00:00
48 lines
988 B
TypeScript
48 lines
988 B
TypeScript
import { mixin, Model } from 'objection';
|
|
import TenantModel from 'models/TenantModel';
|
|
import CustomViewBaseModel from './CustomViewBaseModel';
|
|
import ModelSetting from './ModelSetting';
|
|
import ModelSearchable from './ModelSearchable';
|
|
|
|
export default class ProjectItemEntryRef extends mixin(TenantModel, [
|
|
ModelSetting,
|
|
CustomViewBaseModel,
|
|
ModelSearchable,
|
|
]) {
|
|
/**
|
|
* Table name
|
|
*/
|
|
static get tableName() {
|
|
return 'projects_item_entries_links';
|
|
}
|
|
|
|
/**
|
|
* Timestamps columns.
|
|
*/
|
|
get timestamps() {
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* Virtual attributes.
|
|
*/
|
|
static get virtualAttributes() {
|
|
return [];
|
|
}
|
|
|
|
static get relationMappings() {
|
|
const ItemEntry = require('models/ItemEntry');
|
|
|
|
return {
|
|
itemEntry: {
|
|
relation: Model.BelongsToOneRelation,
|
|
modelClass: ItemEntry.default,
|
|
join: {
|
|
from: 'projects_item_entries_links.itemEntryId',
|
|
to: 'items_entries.id',
|
|
},
|
|
},
|
|
};
|
|
}
|
|
}
|