import type { RaceStatus } from '../../domain/entities/Race';
import type { Result } from '../../domain/entities/Result';
import type { Driver } from '../../domain/entities/Driver';
import type { PenaltyType } from '../../domain/entities/Penalty';
import type { Presenter } from '@core/shared/presentation';

export interface RaceResultsHeaderViewModel {
  id: string;
  leagueId: string;
  track: string;
  scheduledAt: Date;
  status: RaceStatus;
}

export interface RaceResultsLeagueViewModel {
  id: string;
  name: string;
}

export interface RaceResultsPenaltySummaryViewModel {
  driverId: string;
  type: PenaltyType;
  value?: number;
}

export interface RaceResultsDetailViewModel {
  race: RaceResultsHeaderViewModel | null;
  league: RaceResultsLeagueViewModel | null;
  results: Result[];
  drivers: Driver[];
  penalties: RaceResultsPenaltySummaryViewModel[];
  pointsSystem?: Record<number, number>;
  fastestLapTime?: number;
  currentDriverId?: string;
  error?: string;
}

export interface IRaceResultsDetailPresenter
  extends Presenter<RaceResultsDetailViewModel, RaceResultsDetailViewModel> {}