25 lines
681 B
TypeScript
25 lines
681 B
TypeScript
import type { Presenter } from '../../../shared/presentation/Presenter';
|
|
import { AwardPrizeResultDTO } from '../dtos/AwardPrizeDTO';
|
|
|
|
export interface IAwardPrizePresenter extends Presenter<AwardPrizeResultDTO, AwardPrizeResultDTO> {}
|
|
|
|
export class AwardPrizePresenter implements IAwardPrizePresenter {
|
|
private result: AwardPrizeResultDTO | null = null;
|
|
|
|
reset() {
|
|
this.result = null;
|
|
}
|
|
|
|
present(dto: AwardPrizeResultDTO) {
|
|
this.result = dto;
|
|
}
|
|
|
|
getResponseModel(): AwardPrizeResultDTO | null {
|
|
return this.result;
|
|
}
|
|
|
|
get viewModel(): AwardPrizeResultDTO {
|
|
if (!this.result) throw new Error('Presenter not presented');
|
|
return this.result;
|
|
}
|
|
} |