import type { Driver } from '../../domain/entities/Driver';
import type { SkillLevel } from '../../domain/services/SkillLevelService';
import type { Presenter } from '@core/shared/presentation';

export type { SkillLevel };

export interface DriverLeaderboardItemViewModel {
  id: string;
  name: string;
  rating: number;
  skillLevel: SkillLevel;
  nationality: string;
  racesCompleted: number;
  wins: number;
  podiums: number;
  isActive: boolean;
  rank: number;
  avatarUrl: string;
}

export interface DriversLeaderboardViewModel {
  drivers: DriverLeaderboardItemViewModel[];
  totalRaces: number;
  totalWins: number;
  activeCount: number;
}

export interface DriversLeaderboardResultDTO {
  drivers: Driver[];
  rankings: Array<{ driverId: string; rating: number; overallRank: number | null }>;
  stats: Record<
    string,
    {
      rating: number;
      wins: number;
      podiums: number;
      totalRaces: number;
      overallRank: number | null;
    }
  >;
  avatarUrls: Record<string, string>;
}

export interface IDriversLeaderboardPresenter
  extends Presenter<DriversLeaderboardResultDTO, DriversLeaderboardViewModel> {}