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

22 lines
690 B
TypeScript

import { GetSponsorshipPricingViewModel, GetSponsorshipPricingResultDTO, IGetSponsorshipPricingPresenter } from '@core/racing/application/presenters/IGetSponsorshipPricingPresenter';
export class GetSponsorshipPricingPresenter implements IGetSponsorshipPricingPresenter {
private result: GetSponsorshipPricingViewModel | null = null;
reset() {
this.result = null;
}
present(dto: GetSponsorshipPricingResultDTO) {
this.result = dto;
}
getViewModel(): GetSponsorshipPricingViewModel | null {
return this.result;
}
get viewModel(): GetSponsorshipPricingViewModel {
if (!this.result) throw new Error('Presenter not presented');
return this.result;
}
}