Files
gridpilot.gg/apps/website/lib/view-models/RequestAvatarGenerationViewModel.ts
2025-12-18 00:08:47 +01:00

33 lines
824 B
TypeScript

// 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 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;
}
}