refactor driver module (wip)
This commit is contained in:
@@ -10,6 +10,11 @@ import { ReviewProtestPresenter, type ReviewProtestResponseDTO } from './present
|
||||
// Tokens
|
||||
import { LOGGER_TOKEN } from './ProtestsProviders';
|
||||
|
||||
import type { IProtestRepository } from '@core/racing/domain/repositories/IProtestRepository';
|
||||
import type { IRaceRepository } from '@core/racing/domain/repositories/IRaceRepository';
|
||||
import type { ILeagueMembershipRepository } from '@core/racing/domain/repositories/ILeagueMembershipRepository';
|
||||
import { PROTEST_REPOSITORY_TOKEN, RACE_REPOSITORY_TOKEN, LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN } from './ProtestsProviders';
|
||||
|
||||
@Injectable()
|
||||
export class ProtestsService {
|
||||
constructor(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UseCaseOutputPort } from '@core/shared/application';
|
||||
import type { ReviewProtestResult } from '@core/racing/application/use-cases/ReviewProtestUseCase';
|
||||
import type { ReviewProtestResult, ReviewProtestApplicationError } from '@core/racing/application/use-cases/ReviewProtestUseCase';
|
||||
|
||||
export interface ReviewProtestResponseDTO {
|
||||
success: boolean;
|
||||
@@ -25,6 +25,14 @@ export class ReviewProtestPresenter implements UseCaseOutputPort<ReviewProtestRe
|
||||
};
|
||||
}
|
||||
|
||||
presentError(error: ReviewProtestApplicationError): void {
|
||||
this.model = {
|
||||
success: false,
|
||||
errorCode: error.code,
|
||||
message: error.details.message,
|
||||
};
|
||||
}
|
||||
|
||||
getResponseModel(): ReviewProtestResponseDTO | null {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user