2025-08-11 17:49:52 +00:00
|
|
|
import { Customer } from "@erp/customers/api/domain";
|
|
|
|
|
import { CustomersCreationResultDTO } from "@erp/customers/common/dto";
|
|
|
|
|
|
2025-08-14 14:58:13 +00:00
|
|
|
export class CreateCustomersAssembler {
|
2025-08-21 07:44:07 +00:00
|
|
|
public toDTO(customer: Customer): CustomersCreationResultDTO {
|
2025-08-11 17:49:52 +00:00
|
|
|
return {
|
2025-08-21 07:44:07 +00:00
|
|
|
id: customer.id.toPrimitive(),
|
2025-08-11 17:49:52 +00:00
|
|
|
|
2025-08-21 07:44:07 +00:00
|
|
|
customer_status: customer.status.toString(),
|
|
|
|
|
customer_number: customer.customerNumber.toString(),
|
|
|
|
|
customer_series: customer.customerSeries.toString(),
|
|
|
|
|
issue_date: customer.issueDate.toISOString(),
|
|
|
|
|
operation_date: customer.operationDate.toISOString(),
|
2025-08-11 17:49:52 +00:00
|
|
|
language_code: "ES",
|
|
|
|
|
currency: "EUR",
|
|
|
|
|
|
2025-08-21 07:44:07 +00:00
|
|
|
//subtotal_price: customer.calculateSubtotal().toPrimitive(),
|
|
|
|
|
//total_price: customer.calculateTotal().toPrimitive(),
|
2025-08-11 17:49:52 +00:00
|
|
|
|
2025-08-14 14:58:13 +00:00
|
|
|
//recipient: CustomerParticipantAssembler(customer.recipient),
|
2025-08-11 17:49:52 +00:00
|
|
|
|
|
|
|
|
metadata: {
|
|
|
|
|
entity: "customer",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|