refactor page to use services
This commit is contained in:
21
apps/website/lib/view-models/DriverSummaryViewModel.ts
Normal file
21
apps/website/lib/view-models/DriverSummaryViewModel.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { DriverDTO } from '../types/DriverDTO';
|
||||
|
||||
/**
|
||||
* View Model for driver summary with rating and rank
|
||||
* Transform from DTO to ViewModel with UI fields
|
||||
*/
|
||||
export class DriverSummaryViewModel {
|
||||
driver: DriverDTO;
|
||||
rating: number | null;
|
||||
rank: number | null;
|
||||
|
||||
constructor(dto: {
|
||||
driver: DriverDTO;
|
||||
rating?: number | null;
|
||||
rank?: number | null;
|
||||
}) {
|
||||
this.driver = dto.driver;
|
||||
this.rating = dto.rating ?? null;
|
||||
this.rank = dto.rank ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user