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,33 @@
// Note: No generated DTO available for RequestAvatarGeneration yet
interface RequestAvatarGenerationDTO {
success: boolean;
avatarUrl?: string;
error?: string;
}
/**
* Request Avatar Generation View Model
*
* Represents the result of an avatar generation request
*/
export interface RequestAvatarGenerationViewModel {
export class RequestAvatarGenerationViewModel {
success: boolean;
avatarUrl?: string;
error?: string;
constructor(dto: RequestAvatarGenerationDTO) {
this.success = dto.success;
if (dto.avatarUrl !== undefined) this.avatarUrl = dto.avatarUrl;
if (dto.error !== undefined) this.error = dto.error;
}
/** UI-specific: Whether generation was successful */
get isSuccessful(): boolean {
return this.success;
}
/** UI-specific: Whether there was an error */
get hasError(): boolean {
return !!this.error;
}
}