refactor driver module (wip)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user