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,41 @@
import { isNull } from 'lodash';
import { Transformer } from '@/lib/Transformer/Transformer';
import { formatNumber } from 'utils';
import { IContact } from '@/interfaces';
export default class ContactTransfromer extends Transformer {
/**
* Retrieve formatted expense amount.
* @param {IExpense} expense
* @returns {string}
*/
protected formattedBalance = (contact: IContact): string => {
return formatNumber(contact.balance, {
currencyCode: contact.currencyCode,
});
};
/**
* Retrieve formatted expense landed cost amount.
* @param {IExpense} expense
* @returns {string}
*/
protected formattedOpeningBalance = (contact: IContact): string => {
return !isNull(contact.openingBalance)
? formatNumber(contact.openingBalance, {
currencyCode: contact.currencyCode,
})
: '';
};
/**
* Retriecve fromatted date.
* @param {IExpense} expense
* @returns {string}
*/
protected formattedOpeningBalanceAt = (contact: IContact): string => {
return !isNull(contact.openingBalanceAt)
? this.formatDate(contact.openingBalanceAt)
: '';
};
}