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 { VipCodeDataService } from './data/services/vip-code-data.service';
import { VipCodeReadService } from './data/services/vip-code-read.service';
import { VipCodeReadController } from './infrastructure/vip-code-read.controller';
import { VipCodeReadOrchestrator } from './domain/usecases/vip-code-read.orchestrator';
import { VipCodeDataController } from './infrastructure/vip-code-data.controller';
import { VipCodeDataOrchestrator } from './domain/usecases/vip-code-data.orchestrator';
import { CreateVipCodeManager } from './domain/usecases/managers/create-vip-code.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexVipCodeManager } from './domain/usecases/managers/index-vip-code.manager';
import { VipCodeModel } from './data/models/vip-code.model';
import { GenerateVipCodeManager } from './domain/usecases/managers/geneate-vip-code.manager';
import { CreateVipCodeHandler } from './domain/usecases/handlers/create-vip-code.handler';
import { CouchModule } from 'src/modules/configuration/couch/couch.module';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature([VipCodeModel], CONNECTION_NAME.DEFAULT),
    CqrsModule,
    CouchModule,
  ],
  controllers: [VipCodeDataController, VipCodeReadController],
  providers: [
    CreateVipCodeHandler,

    IndexVipCodeManager,
    CreateVipCodeManager,
    GenerateVipCodeManager,

    VipCodeDataService,
    VipCodeReadService,

    VipCodeDataOrchestrator,
    VipCodeReadOrchestrator,
  ],
})
export class VipCodeModule {}
