import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ScheduleModule } from '@nestjs/schedule';
import { APP_GUARD } from '@nestjs/core';
import { JwtAuthGuard } from './domains/identity/guards';
import { PrismaModule } from './shared/prisma/prisma.module';
import { RedisModule } from './shared/redis/redis.module';
import { SystemConfigModule } from './shared/config/system-config.module';
import { IdentityModule } from './domains/identity/identity.module';
import { AgentsModule } from './domains/agent/agents.module';
import { WalletModule } from './domains/ledger/wallet.module';
import { MatchesModule } from './domains/catalog/matches.module';
import { MarketsModule } from './domains/odds/markets.module';
import { BetsModule } from './domains/betting/bets.module';
import { SettlementModule } from './domains/settlement/settlement.module';
import { OperationsModule } from './domains/operations/operations.module';
import { AdminModule } from './applications/admin/admin.module';
import { PlayerModule } from './applications/player/player.module';
import { AgentPortalModule } from './applications/agent/agent-portal.module';
import { HealthModule } from './applications/health/health.module';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    ScheduleModule.forRoot(),
    PrismaModule,
    RedisModule,
    SystemConfigModule,
    IdentityModule,
    AgentsModule,
    WalletModule,
    MatchesModule,
    MarketsModule,
    BetsModule,
    SettlementModule,
    OperationsModule,
    AdminModule,
    PlayerModule,
    AgentPortalModule,
    HealthModule,
  ],
  providers: [{ provide: APP_GUARD, useClass: JwtAuthGuard }],
})
export class AppModule {}
