fix(server): Validation of activate/inacitvate tax rates

This commit is contained in:
Ahmed Bouhuolia
2023-09-20 00:42:34 +02:00
parent 73ceeaee46
commit 453df2ac4e
4 changed files with 8 additions and 4 deletions

View File

@@ -39,6 +39,9 @@ export class ActivateTaxRateService {
// Validates the tax rate existance.
this.validators.validateTaxRateExistance(oldTaxRate);
// Validates the tax rate inactive.
this.validators.validateTaxRateNotActive(oldTaxRate);
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
// Triggers `onTaxRateActivating` event.
await this.eventPublisher.emitAsync(events.taxRates.onActivating, {