mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
add server to monorepo.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import ContactTransfromer from '../ContactTransformer';
|
||||
|
||||
export default class CustomerTransfromer extends ContactTransfromer {
|
||||
/**
|
||||
* Include these attributes to expense object.
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return [
|
||||
'formattedBalance',
|
||||
'formattedOpeningBalance',
|
||||
'formattedOpeningBalanceAt',
|
||||
'customerType',
|
||||
'formattedCustomerType',
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve customer type.
|
||||
* @returns {string}
|
||||
*/
|
||||
protected customerType = (customer): string => {
|
||||
return customer.contactType;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the formatted customer type.
|
||||
* @param customer
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formattedCustomerType = (customer): string => {
|
||||
const keywords = {
|
||||
individual: 'customer.type.individual',
|
||||
business: 'customer.type.business',
|
||||
};
|
||||
return this.context.i18n.__(keywords[customer.contactType] || '');
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user