mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: remove Webpack and depend on nodemon. feat: refactoring expenses. feat: optimize system users with caching. feat: architecture tenant optimize.
41 lines
804 B
JavaScript
41 lines
804 B
JavaScript
import { Model } from 'objection';
|
|
import TenantModel from 'models/TenantModel';
|
|
|
|
export default class ManualJournal extends TenantModel {
|
|
/**
|
|
* Table name.
|
|
*/
|
|
static get tableName() {
|
|
return 'manual_journals';
|
|
}
|
|
|
|
/**
|
|
* Model timestamps.
|
|
*/
|
|
get timestamps() {
|
|
return ['createdAt', 'updatedAt'];
|
|
}
|
|
|
|
/**
|
|
* Relationship mapping.
|
|
*/
|
|
static get relationMappings() {
|
|
const Media = require('models/Media');
|
|
|
|
return {
|
|
media: {
|
|
relation: Model.ManyToManyRelation,
|
|
modelClass: this.relationBindKnex(Media.default),
|
|
join: {
|
|
from: 'manual_journals.id',
|
|
through: {
|
|
from: 'media_links.model_id',
|
|
to: 'media_links.media_id',
|
|
},
|
|
to: 'media.id',
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|