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

32 lines
786 B
TypeScript

import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { UpdateTeamResult } from '@core/racing/application/use-cases/UpdateTeamUseCase';
import type { UpdateTeamOutputDTO } from '../dtos/UpdateTeamOutputDTO';
export class UpdateTeamPresenter implements UseCaseOutputPort<UpdateTeamResult> {
private result: UpdateTeamOutputDTO | null = null;
reset(): void {
this.result = null;
}
present(result: UpdateTeamResult): void {
void result;
this.result = {
success: true,
};
}
getResponseModel(): UpdateTeamOutputDTO | null {
return this.result;
}
get responseModel(): UpdateTeamOutputDTO {
if (!this.result) {
throw new Error('Presenter not presented');
}
return this.result;
}
}