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 { GateDataService } from './data/services/gate-data.service';
import { GateReadService } from './data/services/gate-read.service';
import { GateReadController } from './infrastructure/gate-read.controller';
import { GateReadOrchestrator } from './domain/usecases/gate-read.orchestrator';
import { GateDataController } from './infrastructure/gate-data.controller';
import { GateDataOrchestrator } from './domain/usecases/gate-data.orchestrator';
import { CreateGateManager } from './domain/usecases/managers/create-gate.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexGateManager } from './domain/usecases/managers/index-gate.manager';
import { DeleteGateManager } from './domain/usecases/managers/delete-gate.manager';
import { UpdateGateManager } from './domain/usecases/managers/update-gate.manager';
import { ActiveGateManager } from './domain/usecases/managers/active-gate.manager';
import { ConfirmGateManager } from './domain/usecases/managers/confirm-gate.manager';
import { InactiveGateManager } from './domain/usecases/managers/inactive-gate.manager';
import { DetailGateManager } from './domain/usecases/managers/detail-gate.manager';
import { BatchDeleteGateManager } from './domain/usecases/managers/batch-delete-gate.manager';
import { BatchActiveGateManager } from './domain/usecases/managers/batch-active-gate.manager';
import { BatchConfirmGateManager } from './domain/usecases/managers/batch-confirm-gate.manager';
import { BatchInactiveGateManager } from './domain/usecases/managers/batch-inactive-gate.manager';
import { GateModel } from './data/models/gate.model';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature([GateModel], CONNECTION_NAME.DEFAULT),
    CqrsModule,
  ],
  controllers: [GateDataController, GateReadController],
  providers: [
    IndexGateManager,
    DetailGateManager,
    CreateGateManager,
    DeleteGateManager,
    UpdateGateManager,
    ActiveGateManager,
    ConfirmGateManager,
    InactiveGateManager,
    BatchDeleteGateManager,
    BatchActiveGateManager,
    BatchConfirmGateManager,
    BatchInactiveGateManager,

    GateDataService,
    GateReadService,

    GateDataOrchestrator,
    GateReadOrchestrator,
  ],
})
export class GateModule {}
