import { CreateAccountUseCase } from "@/contexts/accounts/application/create-account.use-case";
import { AccountService } from "@/contexts/accounts/domain";
import { accountRepository } from "@/contexts/accounts/infraestructure";
import { SequelizeTransactionManager } from "@/core/common/infrastructure";
import { CreateAccountController } from "./create-account.controller";
import { createAccountPresenter } from "./create-account.presenter";

export const buildCreateAccountController = () => {
  const transactionManager = new SequelizeTransactionManager();
  const accountService = new AccountService(accountRepository);

  const useCase = new CreateAccountUseCase(accountService, transactionManager);
  const presenter = createAccountPresenter;

  return new CreateAccountController(useCase, presenter);
};
