refactor driver module (wip)

This commit is contained in:
2025-12-22 10:24:40 +01:00
parent e7dbec4a85
commit 9da528d5bd
108 changed files with 842 additions and 947 deletions

View File

@@ -1,29 +1,25 @@
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 {
export class UpdateTeamPresenter implements UseCaseOutputPort<UpdateTeamResult> {
private result: UpdateTeamOutputDTO | null = null;
reset(): void {
this.result = null;
}
presentSuccess(): void {
present(_result: UpdateTeamResult): void {
this.result = {
success: true,
};
}
presentError(): void {
this.result = {
success: false,
};
}
getViewModel(): UpdateTeamOutputDTO | null {
getResponseModel(): UpdateTeamOutputDTO | null {
return this.result;
}
get viewModel(): UpdateTeamOutputDTO {
get responseModel(): UpdateTeamOutputDTO {
if (!this.result) {
throw new Error('Presenter not presented');
}