Files
gridpilot.gg/apps/api/src/domain/payments/presenters/ProcessWalletTransactionPresenter.ts
2025-12-16 15:42:38 +01:00

26 lines
734 B
TypeScript

import type {
IProcessWalletTransactionPresenter,
ProcessWalletTransactionResultDTO,
ProcessWalletTransactionViewModel,
} from '@core/payments/application/presenters/IProcessWalletTransactionPresenter';
export class ProcessWalletTransactionPresenter implements IProcessWalletTransactionPresenter {
private result: ProcessWalletTransactionViewModel | null = null;
reset() {
this.result = null;
}
present(dto: ProcessWalletTransactionResultDTO) {
this.result = dto;
}
getViewModel(): ProcessWalletTransactionViewModel | null {
return this.result;
}
get viewModel(): ProcessWalletTransactionViewModel {
if (!this.result) throw new Error('Presenter not presented');
return this.result;
}
}