mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactor: warehouses to nestjs
This commit is contained in:
@@ -1,29 +1,23 @@
|
||||
import { Service, Inject } from 'typedi';
|
||||
import { Features } from '@/interfaces';
|
||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
|
||||
@Service()
|
||||
export class BranchesSettings {
|
||||
@Inject()
|
||||
private tenancy: HasTenancyService;
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class BranchesSettingsService {
|
||||
/**
|
||||
* Marks multi-branches as activated.
|
||||
* @param {number} tenantId -
|
||||
*/
|
||||
public markMultiBranchesAsActivated = (tenantId: number) => {
|
||||
const settings = this.tenancy.settings(tenantId);
|
||||
public markMultiBranchesAsActivated = () => {
|
||||
// const settings = this.tenancy.settings(tenantId);
|
||||
|
||||
settings.set({ group: 'features', key: Features.BRANCHES, value: 1 });
|
||||
// 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);
|
||||
public isMultiBranchesActive = () => {
|
||||
// const settings = this.tenancy.settings(tenantId);
|
||||
|
||||
return settings.get({ group: 'features', key: Features.BRANCHES });
|
||||
// return settings.get({ group: 'features', key: Features.BRANCHES });
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user