From 39cebda0b9c5f628d23684d6897844e9162c5acf Mon Sep 17 00:00:00 2001 From: sbriat Date: Wed, 23 Aug 2023 14:37:25 +0200 Subject: [PATCH] fix module --- .../geography/core/application/ports/georouter.port.ts | 3 +-- src/modules/geography/geography.module.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/geography/core/application/ports/georouter.port.ts b/src/modules/geography/core/application/ports/georouter.port.ts index 51e56f7..1990e99 100644 --- a/src/modules/geography/core/application/ports/georouter.port.ts +++ b/src/modules/geography/core/application/ports/georouter.port.ts @@ -1,6 +1,5 @@ +import { Path, Route } from '../../domain/route.types'; import { GeorouterSettings } from '../types/georouter-settings.type'; -import { Path } from '../types/path.type'; -import { Route } from '../types/route.type'; export interface GeorouterPort { routes(paths: Path[], settings: GeorouterSettings): Promise; diff --git a/src/modules/geography/geography.module.ts b/src/modules/geography/geography.module.ts index 8c2df42..992869f 100644 --- a/src/modules/geography/geography.module.ts +++ b/src/modules/geography/geography.module.ts @@ -3,6 +3,7 @@ import { CqrsModule } from '@nestjs/cqrs'; import { DIRECTION_ENCODER, GEODESIC, + GEOROUTER, PARAMS_PROVIDER, } from './geography.di-tokens'; import { DefaultParamsProvider } from './infrastructure/default-params-provider'; @@ -10,6 +11,8 @@ import { PostgresDirectionEncoder } from './infrastructure/postgres-direction-en import { GetBasicRouteController } from './interface/controllers/get-basic-route.controller'; import { RouteMapper } from './route.mapper'; import { Geodesic } from './infrastructure/geodesic'; +import { GraphhopperGeorouter } from './infrastructure/graphhopper-georouter'; +import { HttpModule } from '@nestjs/axios'; const mappers: Provider[] = [RouteMapper]; @@ -22,6 +25,10 @@ const adapters: Provider[] = [ provide: DIRECTION_ENCODER, useClass: PostgresDirectionEncoder, }, + { + provide: GEOROUTER, + useClass: GraphhopperGeorouter, + }, { provide: GEODESIC, useClass: Geodesic, @@ -30,7 +37,7 @@ const adapters: Provider[] = [ ]; @Module({ - imports: [CqrsModule], + imports: [CqrsModule, HttpModule], providers: [...mappers, ...adapters], exports: [RouteMapper, DIRECTION_ENCODER, GetBasicRouteController], })