import { CreateSponsorViewModel, CreateSponsorResultDTO, ICreateSponsorPresenter } from '@core/racing/application/presenters/ICreateSponsorPresenter';

export class CreateSponsorPresenter implements ICreateSponsorPresenter {
  private result: CreateSponsorViewModel | null = null;

  reset() {
    this.result = null;
  }

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

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

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