mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
add server to monorepo.
This commit is contained in:
47
packages/server/src/models/ProjectItemEntryRef.ts
Normal file
47
packages/server/src/models/ProjectItemEntryRef.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
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',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user