/**
 * GenerateAvatars ViewData Builder
 *
 * Transforms avatar generation result into ViewData for templates.
 * Must be used in mutations to avoid returning DTOs directly.
 */

import { RequestAvatarGenerationOutputDTO } from '@/lib/types/generated/RequestAvatarGenerationOutputDTO';
import { GenerateAvatarsViewData } from './GenerateAvatarsViewData';

export class GenerateAvatarsViewDataBuilder {
  /**
   * Transform DTO into ViewData
   * 
   * @param apiDto - The API DTO to transform
   * @returns ViewData for templates
   */
  static build(apiDto: RequestAvatarGenerationOutputDTO): GenerateAvatarsViewData {
    return {
      success: apiDto.success,
      avatarUrls: apiDto.avatarUrls || [],
      errorMessage: apiDto.errorMessage,
    };
  }
}