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 { TermConditionDataService } from './data/services/term-condition-data.service';
import { TermConditionReadService } from './data/services/term-condition-read.service';
import { TermConditionReadController } from './infrastructure/term-condition-read.controller';
import { TermConditionReadOrchestrator } from './domain/usecases/term-condition-read.orchestrator';
import { TermConditionDataController } from './infrastructure/term-condition-data.controller';
import { TermConditionDataOrchestrator } from './domain/usecases/term-condition-data.orchestrator';
import { CreateTermConditionManager } from './domain/usecases/managers/create-term-condition.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexTermConditionManager } from './domain/usecases/managers/index-term-condition.manager';
import { DeleteTermConditionManager } from './domain/usecases/managers/delete-term-condition.manager';
import { UpdateTermConditionManager } from './domain/usecases/managers/update-term-condition.manager';
import { ActiveTermConditionManager } from './domain/usecases/managers/active-term-condition.manager';
import { ConfirmTermConditionManager } from './domain/usecases/managers/confirm-term-condition.manager';
import { InactiveTermConditionManager } from './domain/usecases/managers/inactive-term-condition.manager';
import { DetailTermConditionManager } from './domain/usecases/managers/detail-term-condition.manager';
import { BatchDeleteTermConditionManager } from './domain/usecases/managers/batch-delete-term-condition.manager';
import { BatchActiveTermConditionManager } from './domain/usecases/managers/batch-active-term-condition.manager';
import { BatchConfirmTermConditionManager } from './domain/usecases/managers/batch-confirm-term-condition.manager';
import { BatchInactiveTermConditionManager } from './domain/usecases/managers/batch-inactive-term-condition.manager';
import { TermConditionModel } from './data/models/term-condition.model';
import { ChangePositionTermConditionManager } from './domain/usecases/managers/change-position-term-condition.manager';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature([TermConditionModel], CONNECTION_NAME.DEFAULT),
    CqrsModule,
  ],
  controllers: [TermConditionDataController, TermConditionReadController],
  providers: [
    IndexTermConditionManager,
    DetailTermConditionManager,
    CreateTermConditionManager,
    DeleteTermConditionManager,
    UpdateTermConditionManager,
    ActiveTermConditionManager,
    ConfirmTermConditionManager,
    InactiveTermConditionManager,
    BatchDeleteTermConditionManager,
    BatchActiveTermConditionManager,
    BatchConfirmTermConditionManager,
    BatchInactiveTermConditionManager,
    ChangePositionTermConditionManager,

    TermConditionDataService,
    TermConditionReadService,

    TermConditionDataOrchestrator,
    TermConditionReadOrchestrator,
  ],
})
export class TermConditionModule {}
