import type { Presenter } from '../../../shared/presentation/Presenter';
import { GetPrizesResultDTO } from '../dtos/GetPrizesDTO';

export class GetPrizesPresenter implements Presenter<GetPrizesResultDTO, GetPrizesResultDTO> {
  private result: GetPrizesResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

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

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