view models
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user