mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 08:12:40 +00:00
fix modules interactions
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
AD_REPOSITORY,
|
||||
AD_DIRECTION_ENCODER,
|
||||
AD_ROUTE_PROVIDER,
|
||||
AD_GET_BASIC_ROUTE_CONTROLLER,
|
||||
} from './ad.di-tokens';
|
||||
import { MessageBrokerPublisher } from '@mobicoop/message-broker-module';
|
||||
import { AdRepository } from './infrastructure/ad.repository';
|
||||
@@ -12,7 +13,9 @@ import { PrismaService } from './infrastructure/prisma.service';
|
||||
import { AdMapper } from './ad.mapper';
|
||||
import { AdCreatedMessageHandler } from './interface/message-handlers/ad-created.message-handler';
|
||||
import { PostgresDirectionEncoder } from '@modules/geography/infrastructure/postgres-direction-encoder';
|
||||
import { GetRouteController } from '@modules/geography/interface/controllers/get-route.controller';
|
||||
import { GetBasicRouteController } from '@modules/geography/interface/controllers/get-basic-route.controller';
|
||||
import { RouteProvider } from './infrastructure/route-provider';
|
||||
import { GeographyModule } from '@modules/geography/geography.module';
|
||||
|
||||
const messageHandlers = [AdCreatedMessageHandler];
|
||||
|
||||
@@ -41,12 +44,16 @@ const adapters: Provider[] = [
|
||||
},
|
||||
{
|
||||
provide: AD_ROUTE_PROVIDER,
|
||||
useClass: GetRouteController,
|
||||
useClass: RouteProvider,
|
||||
},
|
||||
{
|
||||
provide: AD_GET_BASIC_ROUTE_CONTROLLER,
|
||||
useClass: GetBasicRouteController,
|
||||
},
|
||||
];
|
||||
|
||||
@Module({
|
||||
imports: [CqrsModule],
|
||||
imports: [CqrsModule, GeographyModule],
|
||||
providers: [
|
||||
...messageHandlers,
|
||||
...mappers,
|
||||
|
||||
@@ -4,6 +4,9 @@ import { DIRECTION_ENCODER, PARAMS_PROVIDER } from './geography.di-tokens';
|
||||
import { DefaultParamsProvider } from './infrastructure/default-params-provider';
|
||||
import { PostgresDirectionEncoder } from './infrastructure/postgres-direction-encoder';
|
||||
import { GetBasicRouteController } from './interface/controllers/get-basic-route.controller';
|
||||
import { RouteMapper } from './route.mapper';
|
||||
|
||||
const mappers: Provider[] = [RouteMapper];
|
||||
|
||||
const adapters: Provider[] = [
|
||||
{
|
||||
@@ -19,7 +22,7 @@ const adapters: Provider[] = [
|
||||
|
||||
@Module({
|
||||
imports: [CqrsModule],
|
||||
providers: [...adapters],
|
||||
exports: [DIRECTION_ENCODER, GetBasicRouteController],
|
||||
providers: [...mappers, ...adapters],
|
||||
exports: [RouteMapper, DIRECTION_ENCODER, GetBasicRouteController],
|
||||
})
|
||||
export class GeographyModule {}
|
||||
|
||||
Reference in New Issue
Block a user