import type { Presenter } from '../../../shared/presentation/Presenter';
import { AwardPrizeResultDTO } from '../dtos/AwardPrizeDTO';

export class AwardPrizePresenter implements Presenter<AwardPrizeResultDTO, AwardPrizeResultDTO> {
  private result: AwardPrizeResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

  getResponseModel(): AwardPrizeResultDTO | null {
    return this.result;
  }

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