view data fixes

This commit is contained in:
2026-01-23 15:30:23 +01:00
parent e22033be38
commit f8099f04bc
213 changed files with 3466 additions and 3003 deletions

View File

@@ -1,20 +1,19 @@
import type { RaceStatsDTO } from '@/lib/types/generated/RaceStatsDTO';
/**
* Race stats view model
* Represents race statistics for display
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
import type { RaceStatsViewData } from "../view-data/RaceStatsViewData";
export class RaceStatsViewModel extends ViewModel {
totalRaces: number;
private readonly data: RaceStatsViewData;
constructor(dto: RaceStatsDTO) {
this.totalRaces = dto.totalRaces;
constructor(data: RaceStatsViewData) {
super();
this.data = data;
}
get totalRaces(): number { return this.data.totalRaces; }
/** UI-specific: Formatted total races */
get formattedTotalRaces(): string {
// Client-only formatting
return this.totalRaces.toLocaleString();
}
}