import type {
  IDeletePrizePresenter,
  DeletePrizeResultDTO,
  DeletePrizeViewModel,
} from '@core/payments/application/presenters/IDeletePrizePresenter';

export class DeletePrizePresenter implements IDeletePrizePresenter {
  private result: DeletePrizeViewModel | null = null;

  reset() {
    this.result = null;
  }

  present(dto: DeletePrizeResultDTO) {
    this.result = dto;
  }

  getViewModel(): DeletePrizeViewModel | null {
    return this.result;
  }

  get viewModel(): DeletePrizeViewModel {
    if (!this.result) throw new Error('Presenter not presented');
    return this.result;
  }
}