import { ListUsersUseCase } from "@/contexts/auth/application/list-users/list-users.use-case";
import { userRepository } from "@/contexts/auth/infraestructure";
import { SequelizeTransactionManager } from "@/core/common/infrastructure";
import { UserService } from "../../domain/services/user.service";
import { ListUsersController } from "./list-users.controller";
import { listUsersPresenter } from "./list-users.presenter";

export const buildListUsersController = () => {
  const transactionManager = new SequelizeTransactionManager();
  const userService = new UserService(userRepository);

  const useCase = new ListUsersUseCase(userService, transactionManager);
  const presenter = listUsersPresenter;

  return new ListUsersController(useCase, presenter);
};
