import type { Presenter } from '../../../shared/presentation/Presenter';
import { ProcessWalletTransactionResultDTO } from '../dtos/ProcessWalletTransactionDTO';

export class ProcessWalletTransactionPresenter implements Presenter<ProcessWalletTransactionResultDTO, ProcessWalletTransactionResultDTO> {
  private result: ProcessWalletTransactionResultDTO | null = null;

  reset() {
    this.result = null;
  }

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

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

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