feat: tax rates crud service

This commit is contained in:
Ahmed Bouhuolia
2023-08-11 16:00:39 +02:00
parent 04d134806b
commit d6f56568a3
12 changed files with 189 additions and 50 deletions

View File

@@ -26,10 +26,11 @@ export class EditTaxRateService {
private validators: CommandTaxRatesValidators;
/**
*
* Edits the given tax rate.
* @param {number} tenantId
* @param {number} taxRateId
* @param {IEditTaxRateDTO} taxRateEditDTO
* @returns {Promise<ITaxRate>}
*/
public editTaxRate(
tenantId: number,
@@ -40,6 +41,7 @@ export class EditTaxRateService {
const oldTaxRate = TaxRate.query().findById(taxRateId);
// Validates the tax rate existance.
this.validators.validateTaxRateExistance(oldTaxRate);
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {