mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
add server to monorepo.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { Service, Inject } from 'typedi';
|
||||
import { Features } from '@/interfaces';
|
||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
|
||||
@Service()
|
||||
export class WarehousesSettings {
|
||||
@Inject()
|
||||
tenancy: HasTenancyService;
|
||||
|
||||
/**
|
||||
* Marks multi-warehouses as activated.
|
||||
*/
|
||||
public markMutliwarehoussAsActivated = (tenantId: number) => {
|
||||
const settings = this.tenancy.settings(tenantId);
|
||||
|
||||
settings.set({ group: 'features', key: Features.WAREHOUSES, value: 1 });
|
||||
};
|
||||
|
||||
/**
|
||||
* Detarmines multi-warehouses is active.
|
||||
* @param {number} tenantId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
public isMultiWarehousesActive = (tenantId: number) => {
|
||||
const settings = this.tenancy.settings(tenantId);
|
||||
|
||||
return settings.get({ group: 'features', key: Features.WAREHOUSES });
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user