Files
bigcapital/packages/server/src/services/TaxRates/GetTaxRates.ts
2023-08-11 16:00:39 +02:00

22 lines
486 B
TypeScript

import { Inject, Service } from 'typedi';
import HasTenancyService from '../Tenancy/TenancyService';
@Service()
export class GetTaxRatesService {
@Inject()
private tenancy: HasTenancyService;
/**
* Retrieves the tax rates list.
* @param {number} tenantId
* @returns {Promise<ITaxRate[]>}
*/
public async getTaxRates(tenantId: number) {
const { TaxRate } = this.tenancy.models(tenantId);
const taxRates = await TaxRate.query();
return taxRates;
}
}