mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat: tax rate transformer
This commit is contained in:
20
packages/server/src/services/TaxRates/TaxRateTransformer.ts
Normal file
20
packages/server/src/services/TaxRates/TaxRateTransformer.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
|
||||
export class TaxRateTransformer extends Transformer {
|
||||
/**
|
||||
* Include these attributes to tax rate object.
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return ['nameFormatted'];
|
||||
};
|
||||
|
||||
/**
|
||||
* Formats the tax rate name.
|
||||
* @param taxRate
|
||||
* @returns {string}
|
||||
*/
|
||||
protected nameFormatted = (taxRate): string => {
|
||||
return `${taxRate.name} (${taxRate.rate}%)`;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user