view models

This commit is contained in:
2025-12-20 00:31:31 +01:00
parent 5c74837d73
commit 656ec62426
74 changed files with 4511 additions and 347 deletions

View File

@@ -13,10 +13,13 @@ export class StandingEntryViewModel {
private currentUserId: string;
private previousPosition?: number;
constructor(dto: LeagueStandingDTO, leaderPoints: number, nextPoints: number, currentUserId: string, previousPosition?: number) {
constructor(dto: LeagueStandingDTO & { position: number; points: number; wins?: number; podiums?: number; races?: number }, leaderPoints: number, nextPoints: number, currentUserId: string, previousPosition?: number) {
this.driverId = dto.driverId;
this.position = dto.position;
this.points = dto.points;
this.wins = dto.wins ?? 0;
this.podiums = dto.podiums ?? 0;
this.races = dto.races ?? 0;
this.leaderPoints = leaderPoints;
this.nextPoints = nextPoints;
this.currentUserId = currentUserId;
@@ -31,9 +34,6 @@ export class StandingEntryViewModel {
// Note: The generated DTO is incomplete
// These fields will need to be added when the OpenAPI spec is updated
driver?: any;
wins: number = 0;
podiums: number = 0;
races: number = 0;
/** UI-specific: Points difference to leader */
get pointsGapToLeader(): number {