import type { Presenter } from '../../../shared/presentation/Presenter';
import { CreatePrizeResultDTO } from '../dtos/CreatePrizeDTO';

export class CreatePrizePresenter implements Presenter<CreatePrizeResultDTO, CreatePrizeResultDTO> {
  private result: CreatePrizeResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

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

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