import { Module } from '@nestjs/common';
import { InfrastructureModule } from '@/infrastructure/infrastructure.module';
import { DomainModule } from '@/domain/domain.module';
import { MpcTransferInitializerService } from './services/mpc-transfer-initializer.service';
import { MarketMakerDepositDetectionService } from './services/market-maker-deposit-detection.service';
import { PoolAccountDepositDetectionService } from './services/pool-account-deposit-detection.service';
import { OutboxPublisherService } from './services/outbox-publisher.service';
import { DepositAckConsumerService } from '@/infrastructure/kafka/deposit-ack-consumer.service';
import { AdoptionInjectionHandler } from './event-handlers/adoption-injection.handler';

@Module({
  imports: [InfrastructureModule, DomainModule],
  providers: [
    // MPC 签名客户端注入
    MpcTransferInitializerService,
    // 做市商充值检测服务
    MarketMakerDepositDetectionService,
    // 池账户充值检测服务
    PoolAccountDepositDetectionService,
    // Outbox 事件发布服务（将确认的充值事件发布到 Kafka）
    OutboxPublisherService,
    // 充值 ACK 消费者（接收 wallet-service 的确认回执）
    DepositAckConsumerService,
    // 认种 fUSDT 注入处理器（监听认种事件，自动转积分值到做市商）
    AdoptionInjectionHandler,
  ],
  exports: [OutboxPublisherService],
})
export class ApplicationModule {}
