import { Reunion } from './reunion';

export enum CourseType {
  TIERCE = 'TIERCE',
  QUARTE = 'QUARTE + TIERCE',
  QUINTE = 'QUINTE + TIERCE',
}

export enum CourseStatut {
  PROGRAMMEE = 'PROGRAMMEE',
  CREATED = 'CREATED',
  VALIDATED = 'VALIDATED',
  RUNNING = 'RUNNING',
  CLOSED = 'CLOSED',
  CANCELED = 'CANCELED',
}

export enum ResultatStatut {
  NONE = 'NONE',
  NON_GENERE = 'NON_GENERE',
  CREATED = 'CREATED',
  VALIDATED = 'VALIDATED',
  CONFIRMED = 'CONFIRMED',
}

export interface Course {
  id: string;
  type: CourseType | string; // API returns "Plat" as string
  numero: number;
  nom: string;

  dateDepartCourse: string;
  dateDebutParis: string;
  dateFinParis: string;

  reunion: Reunion;
  reunionCourse: number;

  particularite?: string;
  partants: number;
  distance: number;
  condition?: string;

  statut: CourseStatut | string; // API returns "PROGRAMMEE" as string

  nonPartants: string[];

  // Additional API fields
  estTerminee?: boolean;
  estAnnulee?: boolean;
  nombreChevauxInscrits?: number;
  adeadHeat?: boolean;

  createdBy: string;
  validatedBy?: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
