view models

This commit is contained in:
2025-12-18 00:08:47 +01:00
parent f7a56a92ce
commit 7c449af311
56 changed files with 2594 additions and 206 deletions

View File

@@ -1,10 +1,27 @@
// Note: No generated DTO available for Avatar yet
interface AvatarDTO {
driverId: string;
avatarUrl?: string;
}
/**
* Avatar View Model
*
* Represents avatar information for the UI layer
*/
export interface AvatarViewModel {
export class AvatarViewModel {
driverId: string;
avatarUrl?: string;
hasAvatar: boolean;
constructor(dto: AvatarDTO) {
this.driverId = dto.driverId;
if (dto.avatarUrl !== undefined) {
this.avatarUrl = dto.avatarUrl;
}
}
/** UI-specific: Whether the driver has an avatar */
get hasAvatar(): boolean {
return !!this.avatarUrl;
}
}