add server to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 11:57:50 +02:00
parent 28e309981b
commit 80b97b5fdc
1303 changed files with 137049 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { Service, Inject } from 'typedi';
import { Features } from '@/interfaces';
import HasTenancyService from '@/services/Tenancy/TenancyService';
@Service()
export class BranchesSettings {
@Inject()
private tenancy: HasTenancyService;
/**
* Marks multi-branches as activated.
* @param {number} tenantId -
*/
public markMultiBranchesAsActivated = (tenantId: number) => {
const settings = this.tenancy.settings(tenantId);
settings.set({ group: 'features', key: Features.BRANCHES, value: 1 });
};
/**
* Retrieves whether multi-branches is active.
* @param {number} tenantId
*/
public isMultiBranchesActive = (tenantId: number) => {
const settings = this.tenancy.settings(tenantId);
return settings.get({ group: 'features', key: Features.BRANCHES });
};
}