feat: optimize accounts performance.

feat: optimize alerts architecture.
feat: optimize datatable architecture.
feat: optimize datatable style.
This commit is contained in:
a.bouhuolia
2021-01-26 08:44:11 +02:00
parent 0655963607
commit b26f6c937c
70 changed files with 1607 additions and 1012 deletions

View File

@@ -11,6 +11,7 @@ export default (req: Request, res: Response, next: Function) => {
}
if (!req.tenant.initializedAt) {
Logger.info('[ensure_tenant_initialized_middleware] tenant database not initalized.');
return res.boom.badRequest(
'Tenant database is not migrated with application schema yut.',
{ errors: [{ type: 'TENANT.DATABASE.NOT.INITALIZED' }] },

View File

@@ -31,7 +31,7 @@ export default class Account extends TenantModel {
static get virtualAttributes() {
return [
'accountTypeLabel',
'accountParentTypeLabel',
'accountParentType',
'accountNormal',
'isBalanceSheetAccount',
'isPLSheet'

View File

@@ -160,8 +160,7 @@ export default class ManualJournalsService implements IManualJournalsService {
const manualAccountsIds = manualJournalDTO.entries.map((e) => e.accountId);
const accounts = await Account.query()
.whereIn('id', manualAccountsIds)
.withGraphFetched('type');
.whereIn('id', manualAccountsIds);
const storedAccountsIds = accounts.map((account) => account.id);