import type { Presenter } from '../../../shared/presentation/Presenter';
import { GetMembershipFeesResultDTO } from '../dtos/GetMembershipFeesDTO';

export class GetMembershipFeesPresenter implements Presenter<GetMembershipFeesResultDTO, GetMembershipFeesResultDTO> {
  private result: GetMembershipFeesResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

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

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