import { Module } from '@nestjs/common';
import { LeaderboardCalculationService, REFERRAL_SERVICE_CLIENT, IDENTITY_SERVICE_CLIENT } from '../domain/services/leaderboard-calculation.service';
import { VirtualRankingGeneratorService } from '../domain/services/virtual-ranking-generator.service';
import { RankingMergerService } from '../domain/services/ranking-merger.service';
import { InfrastructureModule } from './infrastructure.module';
import { ReferralServiceClient } from '../infrastructure/external/referral-service.client';
import { IdentityServiceClient } from '../infrastructure/external/identity-service.client';

@Module({
  imports: [InfrastructureModule],
  providers: [
    {
      provide: REFERRAL_SERVICE_CLIENT,
      useExisting: ReferralServiceClient,
    },
    {
      provide: IDENTITY_SERVICE_CLIENT,
      useExisting: IdentityServiceClient,
    },
    LeaderboardCalculationService,
    VirtualRankingGeneratorService,
    RankingMergerService,
  ],
  exports: [
    LeaderboardCalculationService,
    VirtualRankingGeneratorService,
    RankingMergerService,
  ],
})
export class DomainModule {}
