Files
gridpilot.gg/apps/website/lib/view-models/LeagueScheduleRaceViewModel.ts
Marc Mintel 1b0a1f4aee
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 7m11s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-24 23:29:55 +01:00

36 lines
1.2 KiB
TypeScript

import { ViewModel } from "../contracts/view-models/ViewModel";
export class LeagueScheduleRaceViewModel extends ViewModel {
constructor(private readonly data: any) {
super();
}
get id(): string { return this.data.id; }
get name(): string { return this.data.name; }
get scheduledAt(): Date { return new Date(this.data.scheduledAt); }
get formattedDate(): string { return this.data.formattedDate; }
get formattedTime(): string { return this.data.formattedTime; }
get isPast(): boolean { return this.data.isPast; }
get isUpcoming(): boolean { return this.data.isUpcoming; }
get status(): string { return this.data.status; }
get track(): string | undefined { return this.data.track; }
get car(): string | undefined { return this.data.car; }
get sessionType(): string | undefined { return this.data.sessionType; }
get isRegistered(): boolean | undefined { return this.data.isRegistered; }
}
export interface ILeagueScheduleRaceViewModel extends ViewModel {
id: string;
name: string;
scheduledAt: Date;
formattedDate: string;
formattedTime: string;
isPast: boolean;
isUpcoming: boolean;
status: string;
track?: string;
car?: string;
sessionType?: string;
isRegistered?: boolean;
}