import type { GetMediaOutputDto, UploadMediaOutputDto, DeleteMediaOutputDto } from '../dtos';
import type { MediaViewModel, UploadMediaViewModel, DeleteMediaViewModel } from '../view-models';

/**
 * Media Presenter
 * Transforms media DTOs to ViewModels
 */
export class MediaPresenter {
  presentMedia(dto: GetMediaOutputDto): MediaViewModel {
    return {
      id: dto.id,
      url: dto.url,
      type: dto.type,
      category: dto.category,
      uploadedAt: new Date(dto.uploadedAt),
      size: dto.size,
    };
  }

  presentUpload(dto: UploadMediaOutputDto): UploadMediaViewModel {
    return {
      success: dto.success,
      mediaId: dto.mediaId,
      url: dto.url,
      error: dto.error,
    };
  }

  presentDelete(dto: DeleteMediaOutputDto): DeleteMediaViewModel {
    return {
      success: dto.success,
      error: dto.error,
    };
  }
}