mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: Ability to hide/show financial statement header.
This commit is contained in:
@@ -2,9 +2,10 @@ import { Model, mixin } from 'objection';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import SystemModel from '@/system/models/SystemModel';
|
||||
import DateSession from '@/models/DateSession';
|
||||
import UserSubscription from '@/services/Subscription/UserSubscription';
|
||||
|
||||
|
||||
export default class SystemUser extends mixin(SystemModel, [DateSession]) {
|
||||
export default class SystemUser extends mixin(SystemModel, [DateSession, UserSubscription]) {
|
||||
/**
|
||||
* Table name.
|
||||
*/
|
||||
@@ -17,6 +18,7 @@ export default class SystemUser extends mixin(SystemModel, [DateSession]) {
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const Tenant = require('@/system/models/Tenant');
|
||||
const SubscriptionUsage = require('@/system/models/SubscriptionUsage');
|
||||
|
||||
return {
|
||||
tenant: {
|
||||
@@ -27,6 +29,15 @@ export default class SystemUser extends mixin(SystemModel, [DateSession]) {
|
||||
to: 'tenants.id',
|
||||
},
|
||||
},
|
||||
|
||||
subscriptionUsage: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: SubscriptionUsage.default,
|
||||
join: {
|
||||
from: 'users.id',
|
||||
to: 'subscriptions_usage.user_id',
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user