wip league admin tools

This commit is contained in:
2025-12-28 12:04:12 +01:00
parent 5dc8c2399c
commit 6edf12fda8
401 changed files with 15365 additions and 6047 deletions

View File

@@ -1,21 +1,32 @@
/**
* View Model for League Schedule
*
* Represents the league's race schedule in a UI-ready format.
* Service layer maps DTOs into these shapes; UI consumes ViewModels only.
*/
export class LeagueScheduleViewModel {
races: Array<unknown>;
export interface LeagueScheduleRaceViewModel {
id: string;
name: string;
scheduledAt: Date;
isPast: boolean;
isUpcoming: boolean;
status: string;
track?: string;
car?: string;
sessionType?: string;
isRegistered?: boolean;
}
constructor(dto: { races: Array<unknown> }) {
this.races = dto.races;
export class LeagueScheduleViewModel {
readonly races: LeagueScheduleRaceViewModel[];
constructor(races: LeagueScheduleRaceViewModel[]) {
this.races = races;
}
/** UI-specific: Number of races in the schedule */
get raceCount(): number {
return this.races.length;
}
/** UI-specific: Whether the schedule has races */
get hasRaces(): boolean {
return this.raceCount > 0;
}