import { Module } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { CoordinatorIntegrationController } from "./coordinator-integration.controller";
import { CoordinatorIntegrationService } from "./coordinator-integration.service";
import { PrismaModule } from "../prisma/prisma.module";
import { BullMqModule } from "../bullmq/bullmq.module";
import { JobEventsModule } from "../job-events/job-events.module";
import { HeraldModule } from "../herald/herald.module";

/**
 * CoordinatorIntegrationModule - Bridge between Python coordinator and NestJS API
 *
 * Provides REST endpoints for the M4.1 coordinator (Python FastAPI) to
 * communicate with the M4.2 infrastructure (NestJS).
 *
 * Key integration points:
 * - Job creation from coordinator webhook events
 * - Job status updates during processing
 * - Job completion and failure handling
 * - Event bridging to Herald for Discord notifications
 */
@Module({
  imports: [ConfigModule, PrismaModule, BullMqModule, JobEventsModule, HeraldModule],
  controllers: [CoordinatorIntegrationController],
  providers: [CoordinatorIntegrationService],
  exports: [CoordinatorIntegrationService],
})
export class CoordinatorIntegrationModule {}
