2026-04-05 12:01:52 +00:00
|
|
|
import type { CreateSupplierResult, GetSupplierByIdResult, UpdateSupplierByIdResult } from "../api";
|
2026-04-03 20:03:48 +00:00
|
|
|
import type { Supplier } from "../entities";
|
|
|
|
|
|
|
|
|
|
export const GetSupplierByIdAdapter = {
|
2026-04-05 12:01:52 +00:00
|
|
|
fromDTO(dto: GetSupplierByIdResult | CreateSupplierResult | UpdateSupplierByIdResult): Supplier {
|
2026-04-03 20:03:48 +00:00
|
|
|
return {
|
|
|
|
|
id: dto.id,
|
|
|
|
|
companyId: dto.company_id,
|
|
|
|
|
status: dto.status,
|
|
|
|
|
reference: dto.reference,
|
|
|
|
|
|
|
|
|
|
isCompany: dto.is_company === "1",
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
|
|
languageCode: dto.language_code,
|
|
|
|
|
currencyCode: dto.currency_code,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
};
|