refactor payments module

This commit is contained in:
2025-12-22 17:52:59 +01:00
parent 0828506c21
commit c90b2166c1
28 changed files with 524 additions and 268 deletions

View File

@@ -1,11 +1,10 @@
import type {
IGetPrizesPresenter,
GetPrizesResultDTO,
GetPrizesViewModel,
} from '@core/payments/application/presenters/IGetPrizesPresenter';
import type { Presenter } from '@core/shared/presentation/Presenter';
import { GetPrizesResultDTO } from '../dtos/GetPrizesDTO';
export interface IGetPrizesPresenter extends Presenter<GetPrizesResultDTO, GetPrizesResultDTO> {}
export class GetPrizesPresenter implements IGetPrizesPresenter {
private result: GetPrizesViewModel | null = null;
private result: GetPrizesResultDTO | null = null;
reset() {
this.result = null;
@@ -15,11 +14,11 @@ export class GetPrizesPresenter implements IGetPrizesPresenter {
this.result = dto;
}
getViewModel(): GetPrizesViewModel | null {
getResponseModel(): GetPrizesResultDTO | null {
return this.result;
}
get viewModel(): GetPrizesViewModel {
get viewModel(): GetPrizesResultDTO {
if (!this.result) throw new Error('Presenter not presented');
return this.result;
}