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 { DataSchedulingDataService } from './data/services/data-scheduling-data.service';
import { DataSchedulingReadService } from './data/services/data-scheduling-read.service';
import { DataSchedulingReadController } from './infrastructure/data-scheduling-read.controller';
import { DataSchedulingReadOrchestrator } from './domain/usecases/data-scheduling-read.orchestrator';
import {
  DataSchedulingDataController,
  DataSchedulingDefaultController,
  DataSchedulingSetupController,
} from './infrastructure/data-scheduling-data.controller';
import { DataSchedulingDataOrchestrator } from './domain/usecases/data-scheduling-data.orchestrator';
import { CreateDataSchedulingManager } from './domain/usecases/managers/create-data-scheduling.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexDataSchedulingManager } from './domain/usecases/managers/index-data-scheduling.manager';
import { DeleteDataSchedulingManager } from './domain/usecases/managers/delete-data-scheduling.manager';
import { UpdateDataSchedulingManager } from './domain/usecases/managers/update-data-scheduling.manager';
import { ActiveDataSchedulingManager } from './domain/usecases/managers/active-data-scheduling.manager';
import { ConfirmDataSchedulingManager } from './domain/usecases/managers/confirm-data-scheduling.manager';
import { InactiveDataSchedulingManager } from './domain/usecases/managers/inactive-data-scheduling.manager';
import { DetailDataSchedulingManager } from './domain/usecases/managers/detail-data-scheduling.manager';
import { BatchDeleteDataSchedulingManager } from './domain/usecases/managers/batch-delete-data-scheduling.manager';
import { BatchActiveDataSchedulingManager } from './domain/usecases/managers/batch-active-data-scheduling.manager';
import { BatchConfirmDataSchedulingManager } from './domain/usecases/managers/batch-confirm-data-scheduling.manager';
import { BatchInactiveDataSchedulingManager } from './domain/usecases/managers/batch-inactive-data-scheduling.manager';
import { DataSchedulingModel } from './data/models/data-scheduling.model';
import { DataSchedulingDefaultModel } from './data/models/data-scheduling-default.model';
import { DataSchedulingManager } from './domain/usecases/managers/data-scheduling-default.manager';
import { SetupSchedulingGuard } from './infrastructure/guards/setup-scheduling.guard';

import { JwtModule } from '@nestjs/jwt';
import { JWT_EXPIRED } from 'src/core/sessions/constants';
import { JWT_SECRET } from 'src/core/sessions/constants';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [DataSchedulingModel, DataSchedulingDefaultModel],
      CONNECTION_NAME.DEFAULT,
    ),
    JwtModule.register({
      secret: JWT_SECRET,
      signOptions: { expiresIn: JWT_EXPIRED },
    }),
    CqrsModule,
  ],
  controllers: [
    DataSchedulingDataController,
    DataSchedulingReadController,
    DataSchedulingDefaultController,
    DataSchedulingSetupController,
  ],
  providers: [
    SetupSchedulingGuard,
    IndexDataSchedulingManager,
    DetailDataSchedulingManager,
    CreateDataSchedulingManager,
    DeleteDataSchedulingManager,
    UpdateDataSchedulingManager,
    ActiveDataSchedulingManager,
    ConfirmDataSchedulingManager,
    InactiveDataSchedulingManager,
    BatchDeleteDataSchedulingManager,
    BatchActiveDataSchedulingManager,
    BatchConfirmDataSchedulingManager,
    BatchInactiveDataSchedulingManager,

    DataSchedulingDataService,
    DataSchedulingReadService,

    DataSchedulingDataOrchestrator,
    DataSchedulingReadOrchestrator,

    DataSchedulingManager,
  ],
})
export class DataSchedulingModule {}
