import { Column, Entity, PrimaryColumn } from 'typeorm';

@Entity({ name: 'racing_races' })
export class RaceOrmEntity {
  @PrimaryColumn({ type: 'text' })
  id!: string;

  @Column({ type: 'uuid' })
  leagueId!: string;

  @Column({ type: 'timestamptz' })
  scheduledAt!: Date;

  @Column({ type: 'text' })
  track!: string;

  @Column({ type: 'text', nullable: true })
  trackId!: string | null;

  @Column({ type: 'text' })
  car!: string;

  @Column({ type: 'text', nullable: true })
  carId!: string | null;

  @Column({ type: 'text' })
  sessionType!: string;

  @Column({ type: 'text' })
  status!: string;

  @Column({ type: 'int', nullable: true })
  strengthOfField!: number | null;

  @Column({ type: 'int', nullable: true })
  registeredCount!: number | null;

  @Column({ type: 'int', nullable: true })
  maxParticipants!: number | null;
}