import type { Presenter } from '../../../shared/presentation/Presenter';
import { UpsertMembershipFeeResultDTO } from '../dtos/UpsertMembershipFeeDTO';

export class UpsertMembershipFeePresenter implements Presenter<UpsertMembershipFeeResultDTO, UpsertMembershipFeeResultDTO> {
  private result: UpsertMembershipFeeResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

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

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