import { Module, forwardRef } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { InfrastructureModule } from '../infrastructure/infrastructure.module';
import { ApiModule } from '../api/api.module';
import { OrderService } from './services/order.service';
import { TransferService } from './services/transfer.service';
import { PriceService } from './services/price.service';
import { BurnService } from './services/burn.service';
import { AssetService } from './services/asset.service';
import { MarketMakerService } from './services/market-maker.service';
import { OutboxScheduler } from './schedulers/outbox.scheduler';
import { BurnScheduler } from './schedulers/burn.scheduler';
import { PriceBroadcastScheduler } from './schedulers/price-broadcast.scheduler';

@Module({
  imports: [
    ScheduleModule.forRoot(),
    InfrastructureModule,
    forwardRef(() => ApiModule),
  ],
  providers: [
    // Services
    PriceService,
    BurnService,
    AssetService,
    OrderService,
    TransferService,
    MarketMakerService,
    // Schedulers
    OutboxScheduler,
    BurnScheduler,
    PriceBroadcastScheduler,
  ],
  exports: [OrderService, TransferService, PriceService, BurnService, AssetService, MarketMakerService],
})
export class ApplicationModule {}
