import { RaceDetailEntryViewModel } from './RaceDetailEntryViewModel';
import { RaceDetailUserResultViewModel } from './RaceDetailUserResultViewModel';

export type RaceDetailsRaceViewModel = {
  id: string;
  track: string;
  car: string;
  scheduledAt: string;
  status: string;
  sessionType: string;
};

export type RaceDetailsLeagueViewModel = {
  id: string;
  name: string;
  description?: string | null;
  settings?: unknown;
};

export type RaceDetailsRegistrationViewModel = {
  canRegister: boolean;
  isUserRegistered: boolean;
};

export type RaceDetailsViewModel = {
  race: RaceDetailsRaceViewModel | null;
  league: RaceDetailsLeagueViewModel | null;
  entryList: RaceDetailEntryViewModel[];
  registration: RaceDetailsRegistrationViewModel;
  userResult: RaceDetailUserResultViewModel | null;
  canReopenRace: boolean;
  error?: string;
};