fix(server): rename term to

This commit is contained in:
Ahmed Bouhuolia
2024-08-13 13:41:09 +02:00
parent cd90fede54
commit 9991eebaaf
35 changed files with 89 additions and 93 deletions

View File

@@ -0,0 +1,29 @@
import { Transformer } from '@/lib/Transformer/Transformer';
import { SaleInvoiceTransformer } from '../Invoices/SaleInvoiceTransformer';
import { formatNumber } from '@/utils';
export class PaymentReceivedEntryTransfromer extends Transformer {
/**
* Include these attributes to payment receive entry object.
* @returns {Array}
*/
public includeAttributes = (): string[] => {
return ['paymentAmountFormatted', 'invoice'];
};
/**
* Retreives the payment amount formatted.
* @param entry
* @returns {string}
*/
protected paymentAmountFormatted(entry) {
return formatNumber(entry.paymentAmount, { money: false });
}
/**
* Retreives the transformed invoice.
*/
protected invoice(entry) {
return this.item(entry.invoice, new SaleInvoiceTransformer());
}
}