wip league admin tools
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user