import { UpdateAccountUseCase } from "@/contexts/accounts/application";
import { AccountService } from "@/contexts/accounts/domain";
import { accountRepository } from "@/contexts/accounts/infraestructure";
import { SequelizeTransactionManager } from "@/core/common/infrastructure";
import { UpdateAccountController } from "./update-account.controller";
import { updateAccountPresenter } from "./update-account.presenter";

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

  const useCase = new UpdateAccountUseCase(accountService, transactionManager);
  const presenter = updateAccountPresenter;

  return new UpdateAccountController(useCase, presenter);
};
