Files
gridpilot.gg/apps/api/src/domain/payments/presenters/GetPrizesPresenter.ts
2025-12-25 13:40:38 +01:00

23 lines
601 B
TypeScript

import type { Presenter } from '../../../shared/presentation/Presenter';
import { GetPrizesResultDTO } from '../dtos/GetPrizesDTO';
export class GetPrizesPresenter implements Presenter<GetPrizesResultDTO, GetPrizesResultDTO> {
private result: GetPrizesResultDTO | null = null;
reset() {
this.result = null;
}
present(dto: GetPrizesResultDTO) {
this.result = dto;
}
getResponseModel(): GetPrizesResultDTO | null {
return this.result;
}
get viewModel(): GetPrizesResultDTO {
if (!this.result) throw new Error('Presenter not presented');
return this.result;
}
}