view models
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user