27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { ICustomerInvoiceParticipant } from "@/contexts/invoicing/domain";
|
|
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
|
import { IUpdateCustomerInvoice_Participant_Response_DTO } from "@shared/contexts";
|
|
import { CustomerInvoiceParticipantAddressPresenter } from "./CustomerInvoiceParticipantAddress.presenter";
|
|
|
|
export const CustomerInvoiceParticipantPresenter = (
|
|
participant: ICustomerInvoiceParticipant,
|
|
context: IInvoicingContext,
|
|
): IUpdateCustomerInvoice_Participant_Response_DTO | undefined => {
|
|
return {
|
|
id: participant.id.toString(),
|
|
tin: participant.tin.toString(),
|
|
first_name: participant.firstName.toString(),
|
|
last_name: participant.lastName.toString(),
|
|
company_name: participant.companyName.toString(),
|
|
|
|
billing_address: CustomerInvoiceParticipantAddressPresenter(
|
|
participant.billingAddress!,
|
|
context,
|
|
),
|
|
shipping_address: CustomerInvoiceParticipantAddressPresenter(
|
|
participant.shippingAddress!,
|
|
context,
|
|
),
|
|
};
|
|
};
|