import type { Presenter } from '../../../shared/presentation/Presenter';
import { GetWalletResultDTO } from '../dtos/GetWalletDTO';

export class GetWalletPresenter implements Presenter<GetWalletResultDTO, GetWalletResultDTO> {
  private result: GetWalletResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

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

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