mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactoring: custom views service.
fix: constraints of delete item from storage. fix: constraints of delete item category from storage. fix: localize database seeds files. fix: view meta data in accounts list response.
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from 'lib/ViewRolesBuilder';
|
||||
import { flatToNestedArray } from 'utils';
|
||||
import DependencyGraph from 'lib/DependencyGraph';
|
||||
import TenantManagerSubscriber from 'subscribers/tenantManager';
|
||||
|
||||
export default class Account extends TenantModel {
|
||||
/**
|
||||
@@ -24,6 +25,13 @@ export default class Account extends TenantModel {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static get resourceable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model modifiers.
|
||||
*/
|
||||
@@ -106,4 +114,55 @@ export default class Account extends TenantModel {
|
||||
accounts, { itemId: 'id', parentItemId: 'parentAccountId' }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Model defined fields.
|
||||
*/
|
||||
static get fields() {
|
||||
return {
|
||||
name: {
|
||||
label: 'Name',
|
||||
column: 'name',
|
||||
},
|
||||
type: {
|
||||
label: 'Account type',
|
||||
column: 'account_type_id',
|
||||
relation: 'account_types.id',
|
||||
relationColumn: 'account_types.key',
|
||||
},
|
||||
description: {
|
||||
label: 'Description',
|
||||
column: 'description',
|
||||
},
|
||||
code: {
|
||||
label: 'Account code',
|
||||
column: 'code',
|
||||
},
|
||||
root_type: {
|
||||
label: 'Type',
|
||||
column: 'account_type_id',
|
||||
relation: 'account_types.id',
|
||||
relationColumn: 'account_types.root_type',
|
||||
},
|
||||
created_at: {
|
||||
column: 'created_at',
|
||||
columnType: 'date',
|
||||
},
|
||||
active: {
|
||||
column: 'active',
|
||||
},
|
||||
balance: {
|
||||
column: 'amount',
|
||||
columnType: 'number'
|
||||
},
|
||||
currency: {
|
||||
column: 'currency_code',
|
||||
},
|
||||
normal: {
|
||||
column: 'account_type_id',
|
||||
relation: 'account_types.id',
|
||||
relationColumn: 'account_types.normal'
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user