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 { SeasonPeriodDataService } from './data/services/season-period-data.service';
import { SeasonPeriodReadService } from './data/services/season-period-read.service';
import { SeasonPeriodReadController } from './infrastructure/season-period-read.controller';
import { SeasonPeriodReadOrchestrator } from './domain/usecases/season-period-read.orchestrator';
import { SeasonPeriodDataController } from './infrastructure/season-period-data.controller';
import { SeasonPeriodDataOrchestrator } from './domain/usecases/season-period-data.orchestrator';
import { CreateSeasonPeriodManager } from './domain/usecases/managers/create-season-period.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexSeasonPeriodManager } from './domain/usecases/managers/index-season-period.manager';
import { DeleteSeasonPeriodManager } from './domain/usecases/managers/delete-season-period.manager';
import { UpdateSeasonPeriodManager } from './domain/usecases/managers/update-season-period.manager';
import { ActiveSeasonPeriodManager } from './domain/usecases/managers/active-season-period.manager';
import { ConfirmSeasonPeriodManager } from './domain/usecases/managers/confirm-season-period.manager';
import { InactiveSeasonPeriodManager } from './domain/usecases/managers/inactive-season-period.manager';
import { DetailSeasonPeriodManager } from './domain/usecases/managers/detail-season-period.manager';
import { BatchDeleteSeasonPeriodManager } from './domain/usecases/managers/batch-delete-season-period.manager';
import { BatchActiveSeasonPeriodManager } from './domain/usecases/managers/batch-active-season-period.manager';
import { BatchConfirmSeasonPeriodManager } from './domain/usecases/managers/batch-confirm-season-period.manager';
import { BatchInactiveSeasonPeriodManager } from './domain/usecases/managers/batch-inactive-season-period.manager';
import { SeasonPeriodModel } from './data/models/season-period.model';
import { SeasonPeriodHolidayHandler } from './domain/usecases/handlers/season-period-created.handler';
import { IndexSeasonPeriodeItemManager } from './domain/usecases/managers/index-season-period-item.manager';
import { ItemRateModel } from 'src/modules/item-related/item-rate/data/models/item-rate.model';
import { ItemRateReadService } from 'src/modules/item-related/item-rate/data/services/item-rate-read.service';
import { SeasonPeriodPriceUpdatedHandler } from './domain/usecases/handlers/season-period-price-updated.handler';
import { UpdateSeasonPeriodPriceManager } from './domain/usecases/managers/update-season-period-price.manager';
import { CurrentSeasonPeriodManager } from './domain/usecases/managers/get-current-period.manager';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [SeasonPeriodModel, ItemRateModel],
      CONNECTION_NAME.DEFAULT,
    ),
    CqrsModule,
  ],
  controllers: [SeasonPeriodDataController, SeasonPeriodReadController],
  providers: [
    SeasonPeriodHolidayHandler,
    SeasonPeriodPriceUpdatedHandler,

    IndexSeasonPeriodManager,
    IndexSeasonPeriodeItemManager,
    DetailSeasonPeriodManager,
    CreateSeasonPeriodManager,
    DeleteSeasonPeriodManager,
    UpdateSeasonPeriodManager,
    UpdateSeasonPeriodPriceManager,
    ActiveSeasonPeriodManager,
    ConfirmSeasonPeriodManager,
    InactiveSeasonPeriodManager,
    BatchDeleteSeasonPeriodManager,
    BatchActiveSeasonPeriodManager,
    BatchConfirmSeasonPeriodManager,
    BatchInactiveSeasonPeriodManager,
    CurrentSeasonPeriodManager,

    SeasonPeriodDataService,
    SeasonPeriodReadService,
    ItemRateReadService,

    SeasonPeriodDataOrchestrator,
    SeasonPeriodReadOrchestrator,
  ],
})
export class SeasonPeriodModule {}
