Files
gridpilot.gg/apps/website/lib/view-models/ProtestViewModel.ts

33 lines
893 B
TypeScript

import { ProtestDTO } from '../types/generated/ProtestDTO';
/**
* Protest view model
* Represents a race protest
*/
export class ProtestViewModel {
id: string;
raceId: string;
protestingDriverId: string;
accusedDriverId: string;
description: string;
submittedAt: string;
constructor(dto: ProtestDTO) {
this.id = dto.id;
this.raceId = dto.raceId;
this.protestingDriverId = dto.protestingDriverId;
this.accusedDriverId = dto.accusedDriverId;
this.description = dto.description;
this.submittedAt = dto.submittedAt;
}
/** UI-specific: Formatted submitted date */
get formattedSubmittedAt(): string {
return new Date(this.submittedAt).toLocaleString();
}
/** UI-specific: Status display - placeholder since status not in current DTO */
get statusDisplay(): string {
return 'Pending'; // TODO: Update when status is added to DTO
}
}