23 lines
618 B
TypeScript
23 lines
618 B
TypeScript
import type { GetDriverOutputDTO } from '@/lib/types/generated/GetDriverOutputDTO';
|
|
|
|
/**
|
|
* View Model for driver summary with rating and rank
|
|
* Transform from DTO to ViewModel with UI fields
|
|
*/
|
|
import { ViewModel } from "../contracts/view-models/ViewModel";
|
|
|
|
export class DriverSummaryViewModel extends ViewModel {
|
|
driver: GetDriverOutputDTO;
|
|
rating: number | null;
|
|
rank: number | null;
|
|
|
|
constructor(dto: {
|
|
driver: GetDriverOutputDTO;
|
|
rating?: number | null;
|
|
rank?: number | null;
|
|
}) {
|
|
this.driver = dto.driver;
|
|
this.rating = dto.rating ?? null;
|
|
this.rank = dto.rank ?? null;
|
|
}
|
|
} |