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 { TaxDataService } from './data/services/tax-data.service';
import { TaxReadService } from './data/services/tax-read.service';
import { TaxReadController } from './infrastructure/tax-read.controller';
import { TaxReadOrchestrator } from './domain/usecases/tax-read.orchestrator';
import { TaxDataController } from './infrastructure/tax-data.controller';
import { TaxDataOrchestrator } from './domain/usecases/tax-data.orchestrator';
import { CreateTaxManager } from './domain/usecases/managers/create-tax.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexTaxManager } from './domain/usecases/managers/index-tax.manager';
import { DeleteTaxManager } from './domain/usecases/managers/delete-tax.manager';
import { UpdateTaxManager } from './domain/usecases/managers/update-tax.manager';
import { ActiveTaxManager } from './domain/usecases/managers/active-tax.manager';
import { ConfirmTaxManager } from './domain/usecases/managers/confirm-tax.manager';
import { InactiveTaxManager } from './domain/usecases/managers/inactive-tax.manager';
import { DetailTaxManager } from './domain/usecases/managers/detail-tax.manager';
import { BatchDeleteTaxManager } from './domain/usecases/managers/batch-delete-tax.manager';
import { BatchActiveTaxManager } from './domain/usecases/managers/batch-active-tax.manager';
import { BatchConfirmTaxManager } from './domain/usecases/managers/batch-confirm-tax.manager';
import { BatchInactiveTaxManager } from './domain/usecases/managers/batch-inactive-tax.manager';
import { TaxModel } from './data/models/tax.model';
import { SalesPriceFormulaReadService } from '../sales-price-formula/data/services/sales-price-formula-read.service';
import {
  SalesPriceFormulaModel,
  TransactionSettingModel,
} from '../sales-price-formula/data/models/sales-price-formula.model';
import { IndexTaxFormulaManager } from './domain/usecases/managers/index-tax-formula.manager';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [TaxModel, SalesPriceFormulaModel, TransactionSettingModel],
      CONNECTION_NAME.DEFAULT,
    ),
    CqrsModule,
  ],
  controllers: [TaxDataController, TaxReadController],
  providers: [
    IndexTaxManager,
    IndexTaxFormulaManager,
    DetailTaxManager,
    CreateTaxManager,
    DeleteTaxManager,
    UpdateTaxManager,
    ActiveTaxManager,
    ConfirmTaxManager,
    InactiveTaxManager,
    BatchDeleteTaxManager,
    BatchActiveTaxManager,
    BatchConfirmTaxManager,
    BatchInactiveTaxManager,

    SalesPriceFormulaReadService,
    TaxDataService,
    TaxReadService,

    TaxDataOrchestrator,
    TaxReadOrchestrator,
  ],
})
export class TaxModule {}
