refactor driver module (wip)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { RaceDetailOutputPort } from '@core/racing/application/ports/output/RaceDetailOutputPort';
|
||||
import type { RacesPageOutputPort } from '@core/racing/application/ports/output/RacesPageOutputPort';
|
||||
import type { RaceResultsDetailOutputPort } from '@core/racing/application/ports/output/RaceResultsDetailOutputPort';
|
||||
import type { RaceWithSOFOutputPort } from '@core/racing/application/ports/output/RaceWithSOFOutputPort';
|
||||
@@ -130,14 +129,15 @@ export class RaceService {
|
||||
async getRaceDetail(params: GetRaceDetailParamsDTO): Promise<RaceDetailPresenter> {
|
||||
this.logger.debug('[RaceService] Fetching race detail:', params);
|
||||
|
||||
const presenter = new RaceDetailPresenter(this.driverRatingProvider, this.imageService, params);
|
||||
this.getRaceDetailUseCase.setOutput(presenter);
|
||||
|
||||
const result = await this.getRaceDetailUseCase.execute(params);
|
||||
|
||||
if (result.isErr()) {
|
||||
throw new Error('Failed to get race detail');
|
||||
}
|
||||
|
||||
const presenter = new RaceDetailPresenter(this.driverRatingProvider, this.imageService);
|
||||
await presenter.present(result.value as RaceDetailOutputPort, params);
|
||||
return presenter;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user