This commit is contained in:
2025-12-31 19:55:43 +01:00
parent 8260bf7baf
commit 167e82a52b
66 changed files with 5124 additions and 228 deletions

View File

@@ -4,18 +4,22 @@ export class SessionViewModel {
userId: string;
email: string;
displayName: string;
avatarUrl?: string | null;
constructor(dto: AuthenticatedUserDTO) {
this.userId = dto.userId;
this.email = dto.email;
this.displayName = dto.displayName;
const anyDto = dto as unknown as { primaryDriverId?: unknown; driverId?: unknown };
const anyDto = dto as unknown as { primaryDriverId?: unknown; driverId?: unknown; avatarUrl?: unknown };
if (typeof anyDto.primaryDriverId === 'string' && anyDto.primaryDriverId) {
this.driverId = anyDto.primaryDriverId;
} else if (typeof anyDto.driverId === 'string' && anyDto.driverId) {
this.driverId = anyDto.driverId;
}
if (anyDto.avatarUrl !== undefined) {
this.avatarUrl = anyDto.avatarUrl as string | null;
}
}
// Note: The generated DTO doesn't have these fields
@@ -32,12 +36,14 @@ export class SessionViewModel {
email: string;
displayName: string;
primaryDriverId?: string | null;
avatarUrl?: string | null;
} {
return {
userId: this.userId,
email: this.email,
displayName: this.displayName,
primaryDriverId: this.driverId ?? null,
avatarUrl: this.avatarUrl,
};
}