36 lines
1.2 KiB
TypeScript
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;
|
|
}
|