mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: licenses administration basic authentication.
feat: accounts slug. feat: duplicate accounts_balance table and merge balance with accounts table. feat: refactoring customers and vendors. feat: system user soft deleting. feat: preventing build tenant database without any subscription. feat: remove 'password' property from 'req.user' object. feat: refactoring JournalPoster class. feat: delete duplicated directories and files.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Container } from 'typedi';
|
||||
import { Container, Service } from 'typedi';
|
||||
|
||||
@Service()
|
||||
export default class HasTenancyService {
|
||||
/**
|
||||
* Retrieve the given tenant container.
|
||||
@@ -10,6 +11,14 @@ export default class HasTenancyService {
|
||||
return Container.of(`tenant-${tenantId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve knex instance of the given tenant id.
|
||||
* @param {number} tenantId
|
||||
*/
|
||||
knex(tenantId: number) {
|
||||
return this.tenantContainer(tenantId).get('knex');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve models of the givne tenant id.
|
||||
* @param {number} tenantId - The tenant id.
|
||||
@@ -18,11 +27,27 @@ export default class HasTenancyService {
|
||||
return this.tenantContainer(tenantId).get('models');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve repositories of the given tenant id.
|
||||
* @param {number} tenantId
|
||||
*/
|
||||
repositories(tenantId: number) {
|
||||
return this.tenantContainer(tenantId).get('repositories');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve i18n locales methods.
|
||||
* @param {number} tenantId
|
||||
*/
|
||||
i18n(tenantId: number) {
|
||||
this.tenantContainer(tenantId).get('i18n');
|
||||
return this.tenantContainer(tenantId).get('i18n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve tenant cache instance.
|
||||
* @param {number} tenantId -
|
||||
*/
|
||||
cache(tenantId: number) {
|
||||
return this.tenantContainer(tenantId).get('cache');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user