import { LogoutUseCase } from "@/contexts/auth/application";
import { authenticatedUserRepository, tabContextRepository } from "@/contexts/auth/infraestructure";
import { SequelizeTransactionManager } from "@/core/common/infrastructure";
import { AuthService } from "../../domain/services";
import { LogoutController } from "./logout.controller";

export const buildLogoutController = () => {
  const transactionManager = new SequelizeTransactionManager();
  const authService = new AuthService(authenticatedUserRepository, tabContextRepository);

  const useCase = new LogoutUseCase(authService, transactionManager);

  return new LogoutController(useCase);
};
