import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CONNECTION_NAME } from 'src/core/strings/constants/base.constants';
import { UserDataService } from './data/services/user-data.service';
import { UserReadService } from './data/services/user-read.service';
import { UserReadController } from './infrastructure/user-read.controller';
import { UserReadOrchestrator } from './domain/usecases/user-read.orchestrator';
import { UserDataController } from './infrastructure/user-data.controller';
import { UserDataOrchestrator } from './domain/usecases/user-data.orchestrator';
import { CreateUserManager } from './domain/usecases/managers/create-user.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexUserManager } from './domain/usecases/managers/index-user.manager';
import { DeleteUserManager } from './domain/usecases/managers/delete-user.manager';
import { UpdateUserManager } from './domain/usecases/managers/update-user.manager';
import { ActiveUserManager } from './domain/usecases/managers/active-user.manager';
import { ConfirmUserManager } from './domain/usecases/managers/confirm-user.manager';
import { InactiveUserManager } from './domain/usecases/managers/inactive-user.manager';
import { DetailUserManager } from './domain/usecases/managers/detail-user.manager';
import { BatchDeleteUserManager } from './domain/usecases/managers/batch-delete-user.manager';
import { BatchActiveUserManager } from './domain/usecases/managers/batch-active-user.manager';
import { BatchConfirmUserManager } from './domain/usecases/managers/batch-confirm-user.manager';
import { BatchInactiveUserManager } from './domain/usecases/managers/batch-inactive-user.manager';
import { UserModel } from './data/models/user.model';
import { UpdatePasswordUserManager } from './domain/usecases/managers/update-password-user.manager';
import { UserLoginModel } from './data/models/user-login.model';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [UserModel, UserLoginModel],
      CONNECTION_NAME.DEFAULT,
    ),
    CqrsModule,
  ],
  controllers: [UserDataController, UserReadController],
  providers: [
    IndexUserManager,
    DetailUserManager,
    CreateUserManager,
    DeleteUserManager,
    UpdateUserManager,
    UpdatePasswordUserManager,
    ActiveUserManager,
    ConfirmUserManager,
    InactiveUserManager,
    BatchDeleteUserManager,
    BatchActiveUserManager,
    BatchConfirmUserManager,
    BatchInactiveUserManager,

    UserDataService,
    UserReadService,

    UserDataOrchestrator,
    UserReadOrchestrator,
  ],
})
export class UserModule {}
