import { GetCustomerInvoiceUseCase } from "@/contexts/customer-billing/application/";
import { CustomerInvoiceService } from "@/contexts/customer-billing/domain";
import { customerInvoiceRepository } from "@/contexts/customer-billing/infraestructure";
import { SequelizeTransactionManager } from "@/core/common/infrastructure";
import { GetCustomerInvoiceController } from "./get-customer-invoice.controller";
import { getCustomerInvoicesPresenter } from "./get-customer-invoice.presenter";

export const getCustomerInvoiceController = () => {
  const transactionManager = new SequelizeTransactionManager();
  const customerInvoiceService = new CustomerInvoiceService(customerInvoiceRepository);

  const useCase = new GetCustomerInvoiceUseCase(customerInvoiceService, transactionManager);
  const presenter = getCustomerInvoicesPresenter;

  return new GetCustomerInvoiceController(useCase, presenter);
};
