import type { Presenter } from '@core/shared/presentation';

export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro';

export interface TeamLeaderboardItemViewModel {
  id: string;
  name: string;
  memberCount: number;
  rating: number | null;
  totalWins: number;
  totalRaces: number;
  performanceLevel: SkillLevel;
  isRecruiting: boolean;
  createdAt: Date;
  description?: string;
  specialization?: 'endurance' | 'sprint' | 'mixed';
  region?: string;
  languages?: string[];
}

export interface TeamsLeaderboardViewModel {
  teams: TeamLeaderboardItemViewModel[];
  recruitingCount: number;
  /**
   * Teams grouped by their skill level for UI display.
   */
  groupsBySkillLevel: Record<SkillLevel, TeamLeaderboardItemViewModel[]>;
  /**
   * Precomputed top teams ordered for leaderboard preview.
   */
  topTeams: TeamLeaderboardItemViewModel[];
}

export interface TeamsLeaderboardResultDTO {
  teams: unknown[];
  recruitingCount: number;
}

export interface ITeamsLeaderboardPresenter
  extends Presenter<TeamsLeaderboardResultDTO, TeamsLeaderboardViewModel> {}