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], })