Remove most of the geography module and delegate it to external gRPC microservice

This commit is contained in:
Romain Thouvenin
2024-03-13 17:54:34 +01:00
parent d09bad60f7
commit 96c30cb1cc
59 changed files with 237 additions and 2037 deletions

View File

@@ -1,6 +1,5 @@
import { RpcExceptionCode } from '@mobicoop/ddd-library';
import { AD_ROUTE_PROVIDER } from '@modules/ad/ad.di-tokens';
import { RouteProviderPort } from '@modules/ad/core/application/ports/route-provider.port';
import { MatchingResult } from '@modules/ad/core/application/queries/match/match.query-handler';
import { AlgorithmType } from '@modules/ad/core/application/types/algorithm.types';
import { Frequency, Role } from '@modules/ad/core/domain/ad.types';
@@ -17,6 +16,7 @@ import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { QueryBus } from '@nestjs/cqrs';
import { RpcException } from '@nestjs/microservices';
import { Test, TestingModule } from '@nestjs/testing';
import { bareMockGeorouter } from '../georouter.mock';
const originWaypoint: WaypointDto = {
position: 0,
@@ -183,11 +183,6 @@ const mockQueryBus = {
}),
};
const mockRouteProvider: RouteProviderPort = {
getBasic: jest.fn(),
getDetailed: jest.fn(),
};
const mockMatchMapper = {
toResponse: jest.fn().mockImplementation(() => ({
adId: '53a0bf71-4132-4f7b-a4cc-88c796b6bdf1',
@@ -286,7 +281,7 @@ describe('Match Grpc Controller', () => {
},
{
provide: AD_ROUTE_PROVIDER,
useValue: mockRouteProvider,
useValue: bareMockGeorouter,
},
{
provide: MatchMapper,