import type { DeleteMediaResult } from '@core/media/application/use-cases/DeleteMediaUseCase';
import type { DeleteMediaOutputDTO } from '../dtos/DeleteMediaOutputDTO';

type DeleteMediaResponseModel = DeleteMediaOutputDTO;

export class DeleteMediaPresenter {
  private model: DeleteMediaResponseModel | null = null;

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

  transform(result: DeleteMediaResult): DeleteMediaResponseModel {
    this.model = {
      success: result.deleted,
    };
    return this.model;
  }

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

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