/**
 * Application Module
 *
 * mpc-service 作为网关，处理来自其他服务的事件请求
 */

import { Module } from '@nestjs/common';
import { HttpModule } from '@nestjs/axios';
import { InfrastructureModule } from '../infrastructure/infrastructure.module';

// Services
import { MPCCoordinatorService } from './services/mpc-coordinator.service';
import { EventConsumerStarterService } from './services/event-consumer-starter.service';

// Event Handlers
import { KeygenRequestedHandler } from './event-handlers/keygen-requested.handler';
import { SigningRequestedHandler } from './event-handlers/signing-requested.handler';

@Module({
  imports: [
    InfrastructureModule,
    HttpModule,
  ],
  providers: [
    // Application Services
    MPCCoordinatorService,
    EventConsumerStarterService, // 启动 Kafka 消费者

    // Event Handlers (Kafka consumers)
    KeygenRequestedHandler,
    SigningRequestedHandler,
  ],
  exports: [
    MPCCoordinatorService,
  ],
})
export class ApplicationModule {}
