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

type UpdateAvatarResponseModel = UpdateAvatarOutputDTO;

export class UpdateAvatarPresenter implements UseCaseOutputPort<UpdateAvatarResult> {
  private model: UpdateAvatarResponseModel | null = null;

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

  present(result: UpdateAvatarResult): void {
    void result;

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

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

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