diff --git a/modules/customers/src/api/infrastructure/express/controllers/update-customer/index.ts.bak b/modules/customers/src/api/infrastructure/express/controllers/update-customer/index.ts.bak deleted file mode 100644 index e3e00cd2..00000000 --- a/modules/customers/src/api/infrastructure/express/controllers/update-customer/index.ts.bak +++ /dev/null @@ -1,57 +0,0 @@ -import { IInvoicingContext } from "#/server/intrastructure"; -import { CustomerRepository } from "#/server/intrastructure/Customer.repository"; - -export const updateCustomerController = (context: IInvoicingContext) => { - const adapter = context.adapter; - const repoManager = context.repositoryManager; - - repoManager.registerRepository("Customer", (params = { transaction: null }) => { - const { transaction } = params; - - return new CustomerRepository({ - transaction, - adapter, - mapper: createCustomerMapper(context), - }); - }); - - repoManager.registerRepository("Participant", (params = { transaction: null }) => { - const { transaction } = params; - - return new CustomerParticipantRepository({ - transaction, - adapter, - mapper: createCustomerParticipantMapper(context), - }); - }); - - repoManager.registerRepository("ParticipantAddress", (params = { transaction: null }) => { - const { transaction } = params; - - return new CustomerParticipantAddressRepository({ - transaction, - adapter, - mapper: createCustomerParticipantAddressMapper(context), - }); - }); - - repoManager.registerRepository("Contact", (params = { transaction: null }) => { - const { transaction } = params; - - return new ContactRepository({ - transaction, - adapter, - mapper: createContactMapper(context), - }); - }); - - const updateCustomerUseCase = new UpdateCustomerUseCase(context); - - return new UpdateCustomerController( - { - useCase: updateCustomerUseCase, - presenter: updateCustomerPresenter, - }, - context - ); -}; diff --git a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceItem.presenter.ts.bak b/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceItem.presenter.ts.bak deleted file mode 100644 index 5565287c..00000000 --- a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceItem.presenter.ts.bak +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomerItem } from "@/contexts/invoicing/domain/CustomerItems"; -import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext"; -import { ICollection, IMoney_Response_DTO } from "@shared/contexts"; - -export const customerItemPresenter = ( - items: ICollection, - context: IInvoicingContext -) => - items.totalCount > 0 - ? items.items.map((item: CustomerItem) => ({ - description: item.description.toString(), - quantity: item.quantity.toString(), - unit_measure: "", - unit_price: item.unitPrice.toPrimitive() as IMoney_Response_DTO, - subtotal: item.calculateSubtotal().toPrimitive() as IMoney_Response_DTO, - tax_amount: item.calculateTaxAmount().toPrimitive() as IMoney_Response_DTO, - total: item.calculateTotal().toPrimitive() as IMoney_Response_DTO, - })) - : []; diff --git a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceParticipant.presenter.ts.bak b/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceParticipant.presenter.ts.bak deleted file mode 100644 index bf29da73..00000000 --- a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceParticipant.presenter.ts.bak +++ /dev/null @@ -1,26 +0,0 @@ -import { ICustomerParticipant } from "@/contexts/invoicing/domain"; -import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext"; -import { IUpdateCustomer_Participant_Response_DTO } from "@shared/contexts"; -import { CustomerParticipantAddressPresenter } from "./CustomerParticipantAddress.presenter"; - -export const CustomerParticipantPresenter = ( - participant: ICustomerParticipant, - context: IInvoicingContext, -): IUpdateCustomer_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: CustomerParticipantAddressPresenter( - participant.billingAddress!, - context, - ), - shipping_address: CustomerParticipantAddressPresenter( - participant.shippingAddress!, - context, - ), - }; -}; diff --git a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceParticipantAddress.presenter.ts.bak b/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceParticipantAddress.presenter.ts.bak deleted file mode 100644 index 82b4aef7..00000000 --- a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/InvoiceParticipantAddress.presenter.ts.bak +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomerParticipantAddress } from "@/contexts/invoicing/domain"; -import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext"; -import { IUpdateCustomer_AddressParticipant_Response_DTO } from "@shared/contexts"; - -export const CustomerParticipantAddressPresenter = ( - address: CustomerParticipantAddress, - context: IInvoicingContext, -): IUpdateCustomer_AddressParticipant_Response_DTO => { - return { - id: address.id.toString(), - street: address.street.toString(), - city: address.city.toString(), - postal_code: address.postalCode.toString(), - province: address.province.toString(), - country: address.country.toString(), - email: address.email.toString(), - phone: address.phone.toString(), - }; -}; diff --git a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/UpdateInvoice.presenter.ts.bak b/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/UpdateInvoice.presenter.ts.bak deleted file mode 100644 index 53903600..00000000 --- a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/UpdateInvoice.presenter.ts.bak +++ /dev/null @@ -1,33 +0,0 @@ -import { Customer } from "@/contexts/invoicing/domain"; -import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext"; -import { IUpdateCustomer_Response_DTO } from "@shared/contexts"; -import { customerItemPresenter } from "./CustomerItem.presenter"; -import { CustomerParticipantPresenter } from "./CustomerParticipant.presenter"; - -export interface IUpdateCustomerPresenter { - map: (customer: Customer, context: IInvoicingContext) => IUpdateCustomer_Response_DTO; -} - -export const updateCustomerPresenter: IUpdateCustomerPresenter = { - map: (customer: Customer, context: IInvoicingContext): IUpdateCustomer_Response_DTO => { - return { - id: customer.id.toString(), - - customer_status: customer.status.toString(), - customer_number: customer.customerNumber.toString(), - customer_series: customer.customerSeries.toString(), - invoice_date: customer.invoiceDate.toISO8601(), - operation_date: customer.operationDate.toISO8601(), - language_code: customer.language.toString(), - currency: customer.currency.toString(), - subtotal: customer.calculateSubtotal().toPrimitive(), - total: customer.calculateTotal().toPrimitive(), - - //sender: {}, //await CustomerParticipantPresenter(customer.senderId, context), - - recipient: CustomerParticipantPresenter(customer.recipient, context), - - items: customerItemPresenter(customer.items, context), - }; - }, -}; diff --git a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/index.ts.bak b/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/index.ts.bak deleted file mode 100644 index 0ed47025..00000000 --- a/modules/customers/src/api/infrastructure/express/controllers/update-customer/presenter/index.ts.bak +++ /dev/null @@ -1 +0,0 @@ -export * from "./UpdateCustomer.presenter";