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

@Entity({ name: 'driver_stats' })
export class DriverStatsOrmEntity {
  @PrimaryColumn({ type: 'uuid' })
  driverId!: string;

  @Column({ type: 'integer' })
  rating!: number;

  @Column({ type: 'integer' })
  safetyRating!: number;

  @Column({ type: 'numeric', precision: 3, scale: 1 })
  sportsmanshipRating!: number;

  @Column({ type: 'integer' })
  totalRaces!: number;

  @Column({ type: 'integer' })
  wins!: number;

  @Column({ type: 'integer' })
  podiums!: number;

  @Column({ type: 'integer' })
  dnfs!: number;

  @Column({ type: 'numeric', precision: 5, scale: 2 })
  avgFinish!: number;

  @Column({ type: 'integer' })
  bestFinish!: number;

  @Column({ type: 'integer' })
  worstFinish!: number;

  @Column({ type: 'integer' })
  consistency!: number;

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

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