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

@@ -20,6 +20,26 @@ export class CommandTaxRatesValidators {
}
}
/**
* Validates the given tax rate active.
* @param {ITaxRate} taxRate
*/
public validateTaxRateNotActive(taxRate: ITaxRate) {
if (taxRate.active) {
throw new ServiceError(ERRORS.TAX_RATE_ALREADY_ACTIVE);
}
}
/**
* Validates the given tax rate inactive.
* @param {ITaxRate} taxRate
*/
public validateTaxRateNotInactive(taxRate: ITaxRate) {
if (!taxRate.active) {
throw new ServiceError(ERRORS.TAX_RATE_ALREADY_INACTIVE);
}
}
/**
* Validates the tax code uniquiness.
* @param {number} tenantId