api client refactor

This commit is contained in:
2025-12-17 18:01:47 +01:00
parent bab55955e1
commit 4177644b18
190 changed files with 6403 additions and 1624 deletions

View File

@@ -0,0 +1,36 @@
import { SessionDataDto } from '../dtos';
export class SessionViewModel implements SessionDataDto {
userId: string;
email: string;
displayName?: string;
driverId?: string;
isAuthenticated: boolean;
constructor(dto: SessionDataDto) {
Object.assign(this, dto);
}
/** UI-specific: User greeting */
get greeting(): string {
return `Hello, ${this.displayName || this.email}!`;
}
/** UI-specific: Avatar initials */
get avatarInitials(): string {
if (this.displayName) {
return this.displayName.split(' ').map(n => n[0]).join('').toUpperCase();
}
return this.email[0].toUpperCase();
}
/** UI-specific: Whether has driver profile */
get hasDriverProfile(): boolean {
return !!this.driverId;
}
/** UI-specific: Authentication status display */
get authStatusDisplay(): string {
return this.isAuthenticated ? 'Logged In' : 'Logged Out';
}
}