import { Module } from '@nestjs/common';
import { AuthController } from './infrastructure/auth.controller';
import { LoginManager } from './domain/managers/login.manager';
import { LogoutManager } from './domain/managers/logout.manager';
import { AuthOrchestrator } from './domain/auth.orchestrator';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CqrsModule } from '@nestjs/cqrs';
import { UserModel } from 'src/modules/user-related/user/data/models/user.model';
import { CONNECTION_NAME } from 'src/core/strings/constants/base.constants';
import { UserDataService } from 'src/modules/user-related/user/data/services/user-data.service';
import { AuthAdminQueueController } from './infrastructure/auth-admin-queue.controller';
import { AuthAdminQueueOrchestrator } from './domain/auth-admin-queue.orchestrator';
import { LoginAdminQueueManager } from './domain/managers/admin-queue/login-admin-queue.manager';
import { LogoutAdminQueueManager } from './domain/managers/admin-queue/logout-admin-queue.manager';
import { UserLoginModel } from 'src/modules/user-related/user/data/models/user-login.model';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [UserModel, UserLoginModel],
      CONNECTION_NAME.DEFAULT,
    ),
    CqrsModule,
  ],
  controllers: [AuthController, AuthAdminQueueController],
  providers: [
    LoginManager,
    LogoutManager,
    UserDataService,
    AuthOrchestrator,

    // ADMIN QUEUE
    AuthAdminQueueOrchestrator,
    LoginAdminQueueManager,
    LogoutAdminQueueManager,
  ],
})
export class AuthModule {}
