Files
gridpilot.gg/apps/api/src/domain/payments/presenters/DeletePrizePresenter.ts
2025-12-23 17:31:45 +01:00

25 lines
692 B
TypeScript

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