mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
31 lines
670 B
TypeScript
31 lines
670 B
TypeScript
import { Transformer } from '@/lib/Transformer/Transformer';
|
|
import { formatNumber } from 'utils';
|
|
|
|
export default class RefundCreditNoteTransformer extends Transformer {
|
|
/**
|
|
* Includeded attributes.
|
|
* @returns {string[]}
|
|
*/
|
|
public includeAttributes = (): string[] => {
|
|
return ['formttedAmount', 'formattedDate'];
|
|
};
|
|
|
|
/**
|
|
* Formatted amount.
|
|
* @returns {string}
|
|
*/
|
|
protected formttedAmount = (item) => {
|
|
return formatNumber(item.amount, {
|
|
currencyCode: item.currencyCode,
|
|
});
|
|
};
|
|
|
|
/**
|
|
* Formatted date.
|
|
* @returns {string}
|
|
*/
|
|
protected formattedDate = (item) => {
|
|
return this.formatDate(item.date);
|
|
};
|
|
}
|