mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 08:22:41 +00:00
Remove most of the geography module and delegate it to external gRPC microservice
This commit is contained in:
@@ -2,24 +2,12 @@ import { Module, Provider } from '@nestjs/common';
|
||||
import { CqrsModule } from '@nestjs/cqrs';
|
||||
import {
|
||||
DIRECTION_ENCODER,
|
||||
GEODESIC,
|
||||
GEOGRAPHY_CONFIGURATION_REPOSITORY,
|
||||
GEOROUTER,
|
||||
} from './geography.di-tokens';
|
||||
import { PostgresDirectionEncoder } from './infrastructure/postgres-direction-encoder';
|
||||
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';
|
||||
import { GetRouteQueryHandler } from './core/application/queries/get-route/get-route.query-handler';
|
||||
import { GetDetailedRouteController } from './interface/controllers/get-detailed-route.controller';
|
||||
import { ConfigurationRepository } from '@mobicoop/configuration-module';
|
||||
|
||||
const queryHandlers: Provider[] = [GetRouteQueryHandler];
|
||||
|
||||
const mappers: Provider[] = [RouteMapper];
|
||||
|
||||
const adapters: Provider[] = [
|
||||
{
|
||||
provide: GEOGRAPHY_CONFIGURATION_REPOSITORY,
|
||||
@@ -29,26 +17,11 @@ const adapters: Provider[] = [
|
||||
provide: DIRECTION_ENCODER,
|
||||
useClass: PostgresDirectionEncoder,
|
||||
},
|
||||
{
|
||||
provide: GEOROUTER,
|
||||
useClass: GraphhopperGeorouter,
|
||||
},
|
||||
{
|
||||
provide: GEODESIC,
|
||||
useClass: Geodesic,
|
||||
},
|
||||
GetBasicRouteController,
|
||||
GetDetailedRouteController,
|
||||
];
|
||||
|
||||
@Module({
|
||||
imports: [CqrsModule, HttpModule],
|
||||
providers: [...queryHandlers, ...mappers, ...adapters],
|
||||
exports: [
|
||||
RouteMapper,
|
||||
DIRECTION_ENCODER,
|
||||
GetBasicRouteController,
|
||||
GetDetailedRouteController,
|
||||
],
|
||||
providers: [...adapters],
|
||||
exports: [DIRECTION_ENCODER],
|
||||
})
|
||||
export class GeographyModule {}
|
||||
|
||||
Reference in New Issue
Block a user