import { Module } from "@nestjs/common";
import { HttpModule } from "@nestjs/axios";
import { DataFetcherTask } from "./data-fetcher.task";
import { FeatureEnrichmentTask } from "./feature-enrichment.task";
import { HistoricalResultsSyncTask } from "./historical-results-sync.task";
import { LimitResetterTask } from "./limit-resetter.task";
import { PredictionSettlementTask } from "./prediction-settlement.task";
import { PythonEnrichmentTask } from "./python-enrichment.task";
import { TaskLockService } from "./task-lock.service";
import { DatabaseModule } from "../database/database.module";
import { FeederModule } from "../modules/feeder/feeder.module";

@Module({
  imports: [
    HttpModule.register({
      timeout: 30000,
      headers: {
        "User-Agent":
          "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
      },
    }),
    DatabaseModule,
    FeederModule,
  ],
  providers: [
    TaskLockService,
    DataFetcherTask,
    FeatureEnrichmentTask,
    HistoricalResultsSyncTask,
    LimitResetterTask,
    PredictionSettlementTask,
    PythonEnrichmentTask,
  ],
  exports: [
    DataFetcherTask,
    FeatureEnrichmentTask,
    HistoricalResultsSyncTask,
    LimitResetterTask,
    PredictionSettlementTask,
    PythonEnrichmentTask,
  ],
})
export class TasksModule {}
