Files
gridpilot.gg/apps/website/lib/view-models/LeagueScoringConfigViewModel.ts
2025-12-25 00:19:36 +01:00

29 lines
969 B
TypeScript

import { LeagueScoringConfigDTO } from '@/lib/types/generated/LeagueScoringConfigDTO';
/**
* LeagueScoringConfigViewModel
*
* View model for league scoring configuration
*/
export class LeagueScoringConfigViewModel {
readonly gameName: string;
readonly scoringPresetName?: string;
readonly dropPolicySummary?: string;
readonly championships?: Array<{
id: string;
name: string;
type: 'driver' | 'team' | 'nations' | 'trophy' | string;
sessionTypes: string[];
pointsPreview: Array<{ sessionType: string; position: number; points: number }>;
bonusSummary: string[];
dropPolicyDescription?: string;
}>;
constructor(dto: LeagueScoringConfigDTO) {
this.gameName = dto.gameName;
// These would be mapped from extended properties if available
this.scoringPresetName = (dto as any).scoringPresetName;
this.dropPolicySummary = (dto as any).dropPolicySummary;
this.championships = (dto as any).championships;
}
}