mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-11 13:22:41 +00:00
update packages
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import {
|
||||
ConfigurationDomainGet,
|
||||
ConfigurationType,
|
||||
} from '@mobicoop/configuration-module';
|
||||
import { KeyType, Type } from '@mobicoop/configuration-module';
|
||||
|
||||
export const GEOGRAPHY_CONFIG_GEOROUTER_TYPE = 'georouterType';
|
||||
export const GEOGRAPHY_CONFIG_GEOROUTER_URL = 'georouterUrl';
|
||||
|
||||
export const GeographyConfig: ConfigurationDomainGet[] = [
|
||||
export const GeographyKeyTypes: KeyType[] = [
|
||||
{
|
||||
key: GEOGRAPHY_CONFIG_GEOROUTER_TYPE,
|
||||
type: ConfigurationType.STRING,
|
||||
type: Type.STRING,
|
||||
},
|
||||
{
|
||||
key: GEOGRAPHY_CONFIG_GEOROUTER_URL,
|
||||
type: ConfigurationType.STRING,
|
||||
type: Type.STRING,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -15,13 +15,13 @@ import {
|
||||
} from '../core/domain/route.errors';
|
||||
import { GeodesicPort } from '../core/application/ports/geodesic.port';
|
||||
import {
|
||||
ConfigurationDomain,
|
||||
Domain,
|
||||
Configurator,
|
||||
GetConfigurationRepositoryPort,
|
||||
} from '@mobicoop/configuration-module';
|
||||
import {
|
||||
GEOGRAPHY_CONFIG_GEOROUTER_URL,
|
||||
GeographyConfig,
|
||||
GeographyKeyTypes,
|
||||
} from '../geography.constants';
|
||||
|
||||
@Injectable()
|
||||
@@ -42,8 +42,8 @@ export class GraphhopperGeorouter implements GeorouterPort {
|
||||
): Promise<Route> => {
|
||||
const geographyConfigurator: Configurator =
|
||||
await this.configurationRepository.mget(
|
||||
ConfigurationDomain.GEOGRAPHY,
|
||||
GeographyConfig,
|
||||
Domain.GEOGRAPHY,
|
||||
GeographyKeyTypes,
|
||||
);
|
||||
this.url = [
|
||||
geographyConfigurator.get<string>(GEOGRAPHY_CONFIG_GEOROUTER_URL),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
ConfigurationDomain,
|
||||
ConfigurationDomainGet,
|
||||
Domain,
|
||||
KeyType,
|
||||
Configurator,
|
||||
GetConfigurationRepositoryPort,
|
||||
} from '@mobicoop/configuration-module';
|
||||
@@ -272,12 +272,12 @@ const mockConfigurationRepository: GetConfigurationRepositoryPort = {
|
||||
get: jest.fn(),
|
||||
mget: jest.fn().mockImplementation(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
(domain: ConfigurationDomain, configs: ConfigurationDomainGet[]) => {
|
||||
(domain: Domain, keyTypes: KeyType[]) => {
|
||||
switch (domain) {
|
||||
case ConfigurationDomain.GEOGRAPHY:
|
||||
return new Configurator(ConfigurationDomain.GEOGRAPHY, [
|
||||
case Domain.GEOGRAPHY:
|
||||
return new Configurator(Domain.GEOGRAPHY, [
|
||||
{
|
||||
domain: ConfigurationDomain.GEOGRAPHY,
|
||||
domain: Domain.GEOGRAPHY,
|
||||
key: GEOGRAPHY_CONFIG_GEOROUTER_URL,
|
||||
value: 'http://localhost:8989',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user