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 { ProfitShareFormulaReadController } from './infrastructure/profit-share-formula-read.controller';
import { ProfitShareFormulaReadOrchestrator } from './domain/usecases/profit-share-formula-read.orchestrator';
import { ProfitShareFormulaDataController } from './infrastructure/profit-share-formula-data.controller';
import { ProfitShareFormulaDataOrchestrator } from './domain/usecases/profit-share-formula-data.orchestrator';
import { CqrsModule } from '@nestjs/cqrs';
import { UpdateProfitShareFormulaManager } from './domain/usecases/managers/update-profit-share-formula.manager';
import { DetailProfitShareFormulaManager } from './domain/usecases/managers/detail-profit-share-formula.manager';
import { SalesPriceFormulaModel } from '../sales-price-formula/data/models/sales-price-formula.model';
import { TaxDataService } from '../tax/data/services/tax-data.service';
import { TaxModel } from '../tax/data/models/tax.model';
import { IndexProfitShareFormulaManager } from './domain/usecases/managers/index-profit-share-formula.manager';
import { IndexTaxFormulaManager } from './domain/usecases/managers/tax-formula.manager';
import { TaxReadService } from '../tax/data/services/tax-read.service';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [SalesPriceFormulaModel, TaxModel],
      CONNECTION_NAME.DEFAULT,
    ),
    CqrsModule,
  ],
  controllers: [
    ProfitShareFormulaDataController,
    ProfitShareFormulaReadController,
  ],
  providers: [
    DetailProfitShareFormulaManager,
    UpdateProfitShareFormulaManager,
    IndexProfitShareFormulaManager,
    IndexTaxFormulaManager,

    ProfitShareFormulaDataOrchestrator,
    ProfitShareFormulaReadOrchestrator,

    TaxDataService,
    TaxReadService,
  ],
})
export class ProfitShareFormulaModule {}
