import { Module } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { InfrastructureModule } from '../infrastructure/infrastructure.module';

// Services
import { MiningDistributionService } from './services/mining-distribution.service';
import { ContributionSyncService } from './services/contribution-sync.service';
import { NetworkSyncService } from './services/network-sync.service';
import { ManualMiningService } from './services/manual-mining.service';
import { BatchMiningService } from './services/batch-mining.service';

// Queries
import { GetMiningAccountQuery } from './queries/get-mining-account.query';
import { GetMiningStatsQuery } from './queries/get-mining-stats.query';
import { GetPriceQuery } from './queries/get-price.query';

// Event Handlers
import { ContributionEventHandler } from './event-handlers/contribution-event.handler';

// Schedulers
import { MiningScheduler } from './schedulers/mining.scheduler';
import { OutboxScheduler } from './schedulers/outbox.scheduler';

@Module({
  imports: [ScheduleModule.forRoot(), InfrastructureModule],
  providers: [
    // Services
    MiningDistributionService,
    ContributionSyncService,
    NetworkSyncService,
    ManualMiningService,
    BatchMiningService,

    // Queries
    GetMiningAccountQuery,
    GetMiningStatsQuery,
    GetPriceQuery,

    // Event Handlers
    ContributionEventHandler,

    // Schedulers
    MiningScheduler,
    OutboxScheduler,
  ],
  exports: [
    MiningDistributionService,
    ContributionSyncService,
    NetworkSyncService,
    ManualMiningService,
    BatchMiningService,
    GetMiningAccountQuery,
    GetMiningStatsQuery,
    GetPriceQuery,
  ],
})
export class ApplicationModule {}
