import { IUpdateLeagueMemberRolePresenter, UpdateLeagueMemberRoleResultDTO, UpdateLeagueMemberRoleViewModel } from '@core/racing/application/presenters/IUpdateLeagueMemberRolePresenter';

export class UpdateLeagueMemberRolePresenter implements IUpdateLeagueMemberRolePresenter {
  private result: UpdateLeagueMemberRoleViewModel | null = null;

  reset() {
    this.result = null;
  }

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

  getViewModel(): UpdateLeagueMemberRoleViewModel {
    if (!this.result) throw new Error('Presenter not presented');
    return this.result;
  }
}