add server to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 11:57:50 +02:00
parent 28e309981b
commit 80b97b5fdc
1303 changed files with 137049 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
import { Transformer } from '@/lib/Transformer/Transformer';
import { formatNumber } from 'utils';
export class CreditNoteTransformer extends Transformer {
/**
* Include these attributes to sale credit note object.
* @returns {Array}
*/
public includeAttributes = (): string[] => {
return [
'formattedCreditsRemaining',
'formattedCreditNoteDate',
'formattedAmount',
'formattedCreditsUsed'
];
};
/**
* Retrieve formatted credit note date.
* @param {ICreditNote} credit
* @returns {String}
*/
protected formattedCreditNoteDate = (credit): string => {
return this.formatDate(credit.creditNoteDate);
};
/**
* Retrieve formatted invoice amount.
* @param {ICreditNote} credit
* @returns {string}
*/
protected formattedAmount = (credit): string => {
return formatNumber(credit.amount, {
currencyCode: credit.currencyCode,
});
};
/**
* Retrieve formatted credits remaining.
* @param {ICreditNote} credit
* @returns {string}
*/
protected formattedCreditsRemaining = (credit) => {
return formatNumber(credit.creditsRemaining, {
currencyCode: credit.currencyCode,
});
};
/**
* Retrieve formatted credits used.
* @param {ICreditNote} credit
* @returns {string}
*/
protected formattedCreditsUsed = (credit) => {
return formatNumber(credit.creditsUsed, {
currencyCode: credit.currencyCode,
});
};
}