import { GetSponsorsViewModel, GetSponsorsResultDTO, IGetSponsorsPresenter } from '@core/racing/application/presenters/IGetSponsorsPresenter';

export class GetSponsorsPresenter implements IGetSponsorsPresenter {
  private result: GetSponsorsViewModel | null = null;

  reset() {
    this.result = null;
  }

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

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

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