40 lines
973 B
TypeScript
40 lines
973 B
TypeScript
|
|
import type { GetCustomerByIdResponseDTO } from "../../../common";
|
||
|
|
import type { Customer } from "../entities";
|
||
|
|
|
||
|
|
export const mapGetCustomerByIdResponseDtoToCustomerAdapter = (
|
||
|
|
dto: GetCustomerByIdResponseDTO
|
||
|
|
): Customer => ({
|
||
|
|
id: dto.id,
|
||
|
|
companyId: dto.company_id,
|
||
|
|
reference: dto.reference,
|
||
|
|
|
||
|
|
isCompany: dto.is_company,
|
||
|
|
name: dto.name,
|
||
|
|
tradeName: dto.trade_name,
|
||
|
|
tin: dto.tin,
|
||
|
|
|
||
|
|
street: dto.street,
|
||
|
|
street2: dto.street2,
|
||
|
|
city: dto.city,
|
||
|
|
province: dto.province,
|
||
|
|
postalCode: dto.postal_code,
|
||
|
|
country: dto.country,
|
||
|
|
|
||
|
|
primaryEmail: dto.email_primary,
|
||
|
|
secondaryEmail: dto.email_secondary,
|
||
|
|
primaryPhone: dto.phone_primary,
|
||
|
|
secondaryPhone: dto.phone_secondary,
|
||
|
|
primaryMobile: dto.mobile_primary,
|
||
|
|
secondaryMobile: dto.mobile_secondary,
|
||
|
|
|
||
|
|
fax: dto.fax,
|
||
|
|
website: dto.website,
|
||
|
|
|
||
|
|
legalRecord: dto.legal_record,
|
||
|
|
|
||
|
|
defaultTaxes: dto.default_taxes,
|
||
|
|
status: dto.status,
|
||
|
|
languageCode: dto.language_code,
|
||
|
|
currencyCode: dto.currency_code,
|
||
|
|
});
|