feat(server): wip activate/inactivate tax rate

This commit is contained in:
Ahmed Bouhuolia
2023-09-18 01:38:38 +02:00
parent 2356921f27
commit 4e53d08497
10 changed files with 285 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ import { DeleteTaxRateService } from './DeleteTaxRate';
import { EditTaxRateService } from './EditTaxRate';
import { GetTaxRateService } from './GetTaxRate';
import { GetTaxRatesService } from './GetTaxRates';
import { ActivateTaxRateService } from './ActivateTaxRate';
import { InactivateTaxRateService } from './InactivateTaxRate';
@Service()
export class TaxRatesApplication {
@@ -23,6 +25,12 @@ export class TaxRatesApplication {
@Inject()
private getTaxRatesService: GetTaxRatesService;
@Inject()
private activateTaxRateService: ActivateTaxRateService;
@Inject()
private inactivateTaxRateService: InactivateTaxRateService;
/**
* Creates a new tax rate.
* @param {number} tenantId
@@ -80,4 +88,22 @@ export class TaxRatesApplication {
public getTaxRates(tenantId: number) {
return this.getTaxRatesService.getTaxRates(tenantId);
}
/**
* Activates the given tax rate.
* @param {number} tenantId
* @param {number} taxRateId
*/
public activateTaxRate(tenantId: number, taxRateId: number) {
return this.activateTaxRateService.activateTaxRate(tenantId, taxRateId);
}
/**
* Inactivates the given tax rate.
* @param {number} tenantId
* @param {number} taxRateId
*/
public inactivateTaxRate(tenantId: number, taxRateId: number) {
return this.inactivateTaxRateService.inactivateTaxRate(tenantId, taxRateId);
}
}