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

import type { SerializedChampionshipConfig } from '../mappers/ChampionshipConfigJsonMapper';

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

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

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

  @Column({ type: 'jsonb' })
  championships!: SerializedChampionshipConfig[];
}