import type { GetAvatarResult } from '@core/media/application/use-cases/GetAvatarUseCase';
import type { GetAvatarOutputDTO } from '../dtos/GetAvatarOutputDTO';

export type GetAvatarResponseModel = GetAvatarOutputDTO | null;

export class GetAvatarPresenter {
  private model: GetAvatarResponseModel | null = null;

  reset(): void {
    this.model = null;
  }

  transform(result: GetAvatarResult): GetAvatarResponseModel {
    this.model = {
      avatarUrl: result.avatar.mediaUrl,
    };
    return this.model;
  }

  getResponseModel(): GetAvatarResponseModel | null {
    return this.model;
  }

  get responseModel(): GetAvatarResponseModel {
    return this.model ?? null;
  }
}