import { NestFactory } from "@nestjs/core";
import { AppModule } from "../app.module";
import { FeederService } from "../modules/feeder/feeder.service";

async function bootstrap() {
  console.log("🏀 Bootstrapping Basketball Feeder...");
  const app = await NestFactory.createApplicationContext(AppModule, {
    logger: ["log", "error", "warn", "debug", "verbose"],
  });

  const feederService = app.get(FeederService);

  // Run ONLY for basketball
  // Adjust start date if needed, otherwise uses default
  await feederService.runHistoricalScan(["basketball"]);

  console.log("✅ Basketball Feeder finished.");
  await app.close();
}

bootstrap().catch((err) => {
  console.error("❌ Basketball Feeder failed:", err);
  process.exit(1);
});
