import type { UpdateAvatarResult } from '@core/media/application/use-cases/UpdateAvatarUseCase';
import type { UpdateAvatarOutputDTO } from '../dtos/UpdateAvatarOutputDTO';

type UpdateAvatarResponseModel = UpdateAvatarOutputDTO;

export class UpdateAvatarPresenter {
  private model: UpdateAvatarResponseModel | null = null;

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

  transform(result: UpdateAvatarResult): UpdateAvatarResponseModel {
    void result;

    this.model = {
      success: true,
    };
    return this.model;
  }

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

  get responseModel(): UpdateAvatarResponseModel {
    if (!this.model) throw new Error('Presenter not presented');
    return this.model;
  }
}