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 { NewsDataService } from './data/services/news-data.service';
import { NewsReadService } from './data/services/news-read.service';
import { NewsReadController } from './infrastructure/news-read.controller';
import { NewsReadOrchestrator } from './domain/usecases/news-read.orchestrator';
import { NewsDataController } from './infrastructure/news-data.controller';
import { NewsDataOrchestrator } from './domain/usecases/news-data.orchestrator';
import { CreateNewsManager } from './domain/usecases/managers/create-news.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexNewsManager } from './domain/usecases/managers/index-news.manager';
import { DeleteNewsManager } from './domain/usecases/managers/delete-news.manager';
import { UpdateNewsManager } from './domain/usecases/managers/update-news.manager';
import { ActiveNewsManager } from './domain/usecases/managers/active-news.manager';
import { ConfirmNewsManager } from './domain/usecases/managers/confirm-news.manager';
import { InactiveNewsManager } from './domain/usecases/managers/inactive-news.manager';
import { DetailNewsManager } from './domain/usecases/managers/detail-news.manager';
import { BatchDeleteNewsManager } from './domain/usecases/managers/batch-delete-news.manager';
import { BatchActiveNewsManager } from './domain/usecases/managers/batch-active-news.manager';
import { BatchConfirmNewsManager } from './domain/usecases/managers/batch-confirm-news.manager';
import { BatchInactiveNewsManager } from './domain/usecases/managers/batch-inactive-news.manager';
import { NewsModel } from './data/models/news.model';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature([NewsModel], CONNECTION_NAME.DEFAULT),
    CqrsModule,
  ],
  controllers: [NewsDataController, NewsReadController],
  providers: [
    IndexNewsManager,
    DetailNewsManager,
    CreateNewsManager,
    DeleteNewsManager,
    UpdateNewsManager,
    ActiveNewsManager,
    ConfirmNewsManager,
    InactiveNewsManager,
    BatchDeleteNewsManager,
    BatchActiveNewsManager,
    BatchConfirmNewsManager,
    BatchInactiveNewsManager,

    NewsDataService,
    NewsReadService,

    NewsDataOrchestrator,
    NewsReadOrchestrator,
  ],
})
export class NewsModule {}
