import { GetAccountUseCase } from "@/contexts/accounts/application";
import { AccountService } from "@/contexts/accounts/domain";
import { accountRepository } from "@/contexts/accounts/infraestructure";
import { SequelizeTransactionManager } from "@/core/common/infrastructure";
import { GetAccountController } from "./get-account.controller";
import { getAccountPresenter } from "./get-account.presenter";

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

  const useCase = new GetAccountUseCase(accountService, transactionManager);
  const presenter = getAccountPresenter;

  return new GetAccountController(useCase, presenter);
};
