fix module

This commit is contained in:
sbriat 2023-08-23 14:37:25 +02:00
parent 66d4d58dd1
commit 39cebda0b9
2 changed files with 9 additions and 3 deletions

View File

@ -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<Route[]>;

View File

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