remove core from pages
This commit is contained in:
34
apps/website/lib/view-models/RaceViewModel.ts
Normal file
34
apps/website/lib/view-models/RaceViewModel.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { RaceDTO } from '../types/generated/RaceDTO';
|
||||
|
||||
export class RaceViewModel {
|
||||
constructor(private readonly dto: RaceDTO, private readonly _status?: string, private readonly _registeredCount?: number, private readonly _strengthOfField?: number) {}
|
||||
|
||||
get id(): string {
|
||||
return this.dto.id;
|
||||
}
|
||||
|
||||
get name(): string {
|
||||
return this.dto.name;
|
||||
}
|
||||
|
||||
get date(): string {
|
||||
return this.dto.date;
|
||||
}
|
||||
|
||||
get status(): string | undefined {
|
||||
return this._status;
|
||||
}
|
||||
|
||||
get registeredCount(): number | undefined {
|
||||
return this._registeredCount;
|
||||
}
|
||||
|
||||
get strengthOfField(): number | undefined {
|
||||
return this._strengthOfField;
|
||||
}
|
||||
|
||||
/** UI-specific: Formatted date */
|
||||
get formattedDate(): string {
|
||||
return new Date(this.date).toLocaleDateString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user