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 { ReconciliationReadController } from './infrastructure/reconciliation-read.controller';
import { ReconciliationReadOrchestrator } from './domain/usecases/reconciliation-read.orchestrator';
import { ReconciliationDataController } from './infrastructure/reconciliation-data.controller';
import { ReconciliationDataOrchestrator } from './domain/usecases/reconciliation-data.orchestrator';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexReconciliationManager } from './domain/usecases/managers/index-reconciliation.manager';
import { UpdateReconciliationManager } from './domain/usecases/managers/update-reconciliation.manager';
import { ConfirmReconciliationManager } from './domain/usecases/managers/confirm-reconciliation.manager';
import { DetailReconciliationManager } from './domain/usecases/managers/detail-reconciliation.manager';
import { TransactionModel } from '../transaction/data/models/transaction.model';
import { TransactionDataService } from '../transaction/data/services/transaction-data.service';
import { TransactionReadService } from '../transaction/data/services/transaction-read.service';
import { CancelReconciliationManager } from './domain/usecases/managers/cancel-reconciliation.manager';
import { BatchCancelReconciliationManager } from './domain/usecases/managers/batch-cancel-reconciliation.manager';
import { BatchConfirmReconciliationManager } from './domain/usecases/managers/batch-confirm-reconciliation.manager';
import { RecapReconciliationManager } from './domain/usecases/managers/recap-reconciliation.manager';
import { RecapPosTransactionHandler } from './domain/usecases/handlers/recap-pos-transaction.handler';
import { CouchModule } from 'src/modules/configuration/couch/couch.module';
@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature([TransactionModel], CONNECTION_NAME.DEFAULT),
    CqrsModule,
    CouchModule,
  ],
  controllers: [ReconciliationDataController, ReconciliationReadController],
  providers: [
    RecapPosTransactionHandler,

    IndexReconciliationManager,
    DetailReconciliationManager,
    UpdateReconciliationManager,
    ConfirmReconciliationManager,
    BatchConfirmReconciliationManager,
    CancelReconciliationManager,
    BatchCancelReconciliationManager,
    RecapReconciliationManager,

    TransactionDataService,
    TransactionReadService,

    ReconciliationDataOrchestrator,
    ReconciliationReadOrchestrator,
  ],
})
export class ReconciliationModule {}
