refactoring: balance sheet report.

refactoring: trial balance sheet report.
refactoring: general ledger report.
refactoring: journal report.
refactoring: P&L report.
This commit is contained in:
Ahmed Bouhuolia
2020-12-10 13:04:49 +02:00
parent e8f329e29e
commit d49992a6d7
71 changed files with 3203 additions and 1571 deletions

View File

@@ -1,16 +1,45 @@
import { Container } from 'typedi';
import TenancyService from 'services/Tenancy/TenancyService';
import CachableRepository from './CachableRepository';
export default class TenantRepository {
export default class TenantRepository extends CachableRepository {
repositoryName: string;
tenantId: number;
tenancy: TenancyService;
modelsInstance: any;
repositoriesInstance: any;
cacheInstance: any;
/**
* Constructor method.
* @param {number} tenantId
*/
constructor(tenantId: number) {
super();
this.tenantId = tenantId;
this.tenancy = Container.get(TenancyService);
this.repositoryName = this.constructor.name;
}
get models() {
if (!this.modelsInstance) {
this.modelsInstance = this.tenancy.models(this.tenantId);
}
return this.modelsInstance;
}
get repositories() {
if (!this.repositoriesInstance) {
this.repositoriesInstance = this.tenancy.repositories(this.tenantId);
}
return this.repositoriesInstance;
}
get cache() {
if (!this.cacheInstance) {
this.cacheInstance = this.tenancy.cache(this.tenantId);
}
return this.cacheInstance;
}
}