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 { ItemCategoryDataService } from './data/services/item-category-data.service';
import { ItemCategoryReadService } from './data/services/item-category-read.service';
import { ItemCategoryReadController } from './infrastructure/item-category-read.controller';
import { ItemCategoryReadOrchestrator } from './domain/usecases/item-category-read.orchestrator';
import { ItemCategoryDataController } from './infrastructure/item-category-data.controller';
import { ItemCategoryDataOrchestrator } from './domain/usecases/item-category-data.orchestrator';
import { CreateItemCategoryManager } from './domain/usecases/managers/create-item-category.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexItemCategoryManager } from './domain/usecases/managers/index-item-category.manager';
import { DeleteItemCategoryManager } from './domain/usecases/managers/delete-item-category.manager';
import { UpdateItemCategoryManager } from './domain/usecases/managers/update-item-category.manager';
import { ActiveItemCategoryManager } from './domain/usecases/managers/active-item-category.manager';
import { ConfirmItemCategoryManager } from './domain/usecases/managers/confirm-item-category.manager';
import { InactiveItemCategoryManager } from './domain/usecases/managers/inactive-item-category.manager';
import { DetailItemCategoryManager } from './domain/usecases/managers/detail-item-category.manager';
import { BatchDeleteItemCategoryManager } from './domain/usecases/managers/batch-delete-item-category.manager';
import { BatchActiveItemCategoryManager } from './domain/usecases/managers/batch-active-item-category.manager';
import { BatchConfirmItemCategoryManager } from './domain/usecases/managers/batch-confirm-item-category.manager';
import { BatchInactiveItemCategoryManager } from './domain/usecases/managers/batch-inactive-item-category.manager';
import { ItemCategoryModel } from './data/models/item-category.model';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature([ItemCategoryModel], CONNECTION_NAME.DEFAULT),
    CqrsModule,
  ],
  controllers: [ItemCategoryDataController, ItemCategoryReadController],
  providers: [
    IndexItemCategoryManager,
    DetailItemCategoryManager,
    CreateItemCategoryManager,
    DeleteItemCategoryManager,
    UpdateItemCategoryManager,
    ActiveItemCategoryManager,
    ConfirmItemCategoryManager,
    InactiveItemCategoryManager,
    BatchDeleteItemCategoryManager,
    BatchActiveItemCategoryManager,
    BatchConfirmItemCategoryManager,
    BatchInactiveItemCategoryManager,

    ItemCategoryDataService,
    ItemCategoryReadService,

    ItemCategoryDataOrchestrator,
    ItemCategoryReadOrchestrator,
  ],
})
export class ItemCategoryModule {}
