import type {
  IGetMembershipFeesPresenter,
  GetMembershipFeesResultDTO,
  GetMembershipFeesViewModel,
} from '@core/payments/application/presenters/IGetMembershipFeesPresenter';

export class GetMembershipFeesPresenter implements IGetMembershipFeesPresenter {
  private result: GetMembershipFeesViewModel | null = null;

  reset() {
    this.result = null;
  }

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

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

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