/**
 * Race Detail View Data
 * 
 * ViewData for the race detail page template.
 * JSON-serializable, template-ready data structure.
 */

export interface RaceDetailEntry {
  id: string;
  name: string;
  avatarUrl: string;
  country: string;
  rating?: number;
  isCurrentUser: boolean;
}

export interface RaceDetailUserResult {
  position: number;
  startPosition: number;
  positionChange: number;
  incidents: number;
  isClean: boolean;
  isPodium: boolean;
  ratingChange?: number;
}

export interface RaceDetailLeague {
  id: string;
  name: string;
  description?: string;
  settings: {
    maxDrivers: number;
    qualifyingFormat: string;
  };
}

export interface RaceDetailRace {
  id: string;
  track: string;
  car: string;
  scheduledAt: string;
  status: 'scheduled' | 'running' | 'completed' | 'cancelled';
  sessionType: string;
}

export interface RaceDetailRegistration {
  isUserRegistered: boolean;
  canRegister: boolean;
}

export interface RaceDetailViewData {
  race: RaceDetailRace;
  league?: RaceDetailLeague;
  entryList: RaceDetailEntry[];
  registration: RaceDetailRegistration;
  userResult?: RaceDetailUserResult;
  canReopenRace: boolean;
}