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

@@ -11,16 +11,17 @@ export class GetTaxRateService {
private validators: CommandTaxRatesValidators;
/**
*
* Retrieves the given tax rate.
* @param {number} tenantId
* @param {number} taxRateId
* @returns
* @returns {Promise<ITaxRate>}
*/
public async getTaxRate(tenantId: number, taxRateId: number) {
const { TaxRate } = this.tenancy.models(tenantId);
const taxRate = await TaxRate.query().findById(taxRateId);
// Validates the tax rate existance.
this.validators.validateTaxRateExistance(taxRate);
return taxRate;