feat: tax rate transformer

This commit is contained in:
Ahmed Bouhuolia
2023-09-11 20:46:46 +02:00
parent 7657337c4f
commit 6abae43c6f
8 changed files with 101 additions and 5 deletions

View 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}%)`;
};
}