From a54694c5a90acba9d37b48009ce5bfe2d9ffe248 Mon Sep 17 00:00:00 2001 From: sbriat Date: Fri, 21 Apr 2023 10:13:22 +0200 Subject: [PATCH] divide domain to ecosystem / engine --- .../adapters/primaries/matcher.controller.ts | 2 +- .../adapters/secondaries/ad.repository.ts | 2 +- .../secondaries/graphhopper-georouter.ts | 6 +++--- .../domain/entities/{ => ecosystem}/actor.ts | 4 ++-- .../domain/entities/{ => ecosystem}/ad.ts | 0 .../{ => ecosystem}/algorithm-settings.ts | 12 +++++------ .../entities/{ => ecosystem}/geography.ts | 16 +++++++------- .../domain/entities/{ => ecosystem}/match.ts | 0 .../entities/{ => ecosystem}/named-route.ts | 0 .../domain/entities/{ => ecosystem}/person.ts | 2 +- .../entities/{ => ecosystem}/requirement.ts | 2 +- .../domain/entities/{ => ecosystem}/route.ts | 4 ++-- .../{ => ecosystem}/spacetime-point.ts | 0 .../domain/entities/{ => ecosystem}/time.ts | 10 ++++----- .../entities/{ => ecosystem}/waypoint.ts | 2 +- .../domain/entities/engine/candidate.ts | 5 +++++ .../factory/algorithm-factory.abstract.ts | 15 +++++++++++++ .../domain/entities/engine/factory/classic.ts | 9 ++++++++ .../matcher/domain/entities/engine/matcher.ts | 21 +++++++++++++++++++ .../entities/engine/processor.abstract.ts | 12 +++++++++++ .../classic-waypoint.completer.processor.ts | 8 +++++++ .../processor/completer/completer.abstract.ts | 9 ++++++++ .../matcher/domain/usecases/match.usecase.ts | 4 ++-- src/modules/matcher/queries/match.query.ts | 10 ++++----- .../domain/{ => ecosystem}/geography.spec.ts | 17 ++++++++------- .../domain/{ => ecosystem}/person.spec.ts | 2 +- .../unit/domain/{ => ecosystem}/route.spec.ts | 6 +++--- .../unit/domain/{ => ecosystem}/time.spec.ts | 2 +- 28 files changed, 132 insertions(+), 50 deletions(-) rename src/modules/matcher/domain/entities/{ => ecosystem}/actor.ts (71%) rename src/modules/matcher/domain/entities/{ => ecosystem}/ad.ts (100%) rename src/modules/matcher/domain/entities/{ => ecosystem}/algorithm-settings.ts (82%) rename src/modules/matcher/domain/entities/{ => ecosystem}/geography.ts (92%) rename src/modules/matcher/domain/entities/{ => ecosystem}/match.ts (100%) rename src/modules/matcher/domain/entities/{ => ecosystem}/named-route.ts (100%) rename src/modules/matcher/domain/entities/{ => ecosystem}/person.ts (93%) rename src/modules/matcher/domain/entities/{ => ecosystem}/requirement.ts (82%) rename src/modules/matcher/domain/entities/{ => ecosystem}/route.ts (93%) rename src/modules/matcher/domain/entities/{ => ecosystem}/spacetime-point.ts (100%) rename src/modules/matcher/domain/entities/{ => ecosystem}/time.ts (93%) rename src/modules/matcher/domain/entities/{ => ecosystem}/waypoint.ts (83%) create mode 100644 src/modules/matcher/domain/entities/engine/candidate.ts create mode 100644 src/modules/matcher/domain/entities/engine/factory/algorithm-factory.abstract.ts create mode 100644 src/modules/matcher/domain/entities/engine/factory/classic.ts create mode 100644 src/modules/matcher/domain/entities/engine/matcher.ts create mode 100644 src/modules/matcher/domain/entities/engine/processor.abstract.ts create mode 100644 src/modules/matcher/domain/entities/engine/processor/completer/classic-waypoint.completer.processor.ts create mode 100644 src/modules/matcher/domain/entities/engine/processor/completer/completer.abstract.ts rename src/modules/matcher/tests/unit/domain/{ => ecosystem}/geography.spec.ts (92%) rename src/modules/matcher/tests/unit/domain/{ => ecosystem}/person.spec.ts (93%) rename src/modules/matcher/tests/unit/domain/{ => ecosystem}/route.spec.ts (88%) rename src/modules/matcher/tests/unit/domain/{ => ecosystem}/time.spec.ts (98%) diff --git a/src/modules/matcher/adapters/primaries/matcher.controller.ts b/src/modules/matcher/adapters/primaries/matcher.controller.ts index 959910c..d1859ff 100644 --- a/src/modules/matcher/adapters/primaries/matcher.controller.ts +++ b/src/modules/matcher/adapters/primaries/matcher.controller.ts @@ -6,11 +6,11 @@ import { GrpcMethod, RpcException } from '@nestjs/microservices'; import { RpcValidationPipe } from 'src/modules/utils/pipes/rpc.validation-pipe'; import { MatchRequest } from '../../domain/dtos/match.request'; import { ICollection } from 'src/modules/database/src/interfaces/collection.interface'; -import { Match } from '../../domain/entities/match'; import { MatchQuery } from '../../queries/match.query'; import { MatchPresenter } from '../secondaries/match.presenter'; import { DefaultParamsProvider } from '../secondaries/default-params.provider'; import { GeorouterCreator } from '../secondaries/georouter-creator'; +import { Match } from '../../domain/entities/ecosystem/match'; @UsePipes( new RpcValidationPipe({ diff --git a/src/modules/matcher/adapters/secondaries/ad.repository.ts b/src/modules/matcher/adapters/secondaries/ad.repository.ts index 696bac9..9915f1f 100644 --- a/src/modules/matcher/adapters/secondaries/ad.repository.ts +++ b/src/modules/matcher/adapters/secondaries/ad.repository.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { MatcherRepository } from '../../../database/src/domain/matcher-repository'; -import { Ad } from '../../domain/entities/ad'; +import { Ad } from '../../domain/entities/ecosystem/ad'; @Injectable() export class AdRepository extends MatcherRepository { diff --git a/src/modules/matcher/adapters/secondaries/graphhopper-georouter.ts b/src/modules/matcher/adapters/secondaries/graphhopper-georouter.ts index 5d1fd84..26d2e23 100644 --- a/src/modules/matcher/adapters/secondaries/graphhopper-georouter.ts +++ b/src/modules/matcher/adapters/secondaries/graphhopper-georouter.ts @@ -1,14 +1,14 @@ import { HttpService } from '@nestjs/axios'; -import { NamedRoute } from '../../domain/entities/named-route'; import { IGeorouter } from '../../domain/interfaces/georouter.interface'; import { GeorouterSettings } from '../../domain/types/georouter-settings.type'; import { Path } from '../../domain/types/path.type'; import { Injectable } from '@nestjs/common'; import { catchError, lastValueFrom, map } from 'rxjs'; import { AxiosError, AxiosResponse } from 'axios'; -import { Route } from '../../domain/entities/route'; -import { SpacetimePoint } from '../../domain/entities/spacetime-point'; import { IGeodesic } from '../../domain/interfaces/geodesic.interface'; +import { NamedRoute } from '../../domain/entities/ecosystem/named-route'; +import { Route } from '../../domain/entities/ecosystem/route'; +import { SpacetimePoint } from '../../domain/entities/ecosystem/spacetime-point'; @Injectable() export class GraphhopperGeorouter implements IGeorouter { diff --git a/src/modules/matcher/domain/entities/actor.ts b/src/modules/matcher/domain/entities/ecosystem/actor.ts similarity index 71% rename from src/modules/matcher/domain/entities/actor.ts rename to src/modules/matcher/domain/entities/ecosystem/actor.ts index 075b8b4..25436e5 100644 --- a/src/modules/matcher/domain/entities/actor.ts +++ b/src/modules/matcher/domain/entities/ecosystem/actor.ts @@ -1,5 +1,5 @@ -import { Role } from '../types/role.enum'; -import { Step } from '../types/step.enum'; +import { Role } from '../../types/role.enum'; +import { Step } from '../../types/step.enum'; import { Person } from './person'; export class Actor { diff --git a/src/modules/matcher/domain/entities/ad.ts b/src/modules/matcher/domain/entities/ecosystem/ad.ts similarity index 100% rename from src/modules/matcher/domain/entities/ad.ts rename to src/modules/matcher/domain/entities/ecosystem/ad.ts diff --git a/src/modules/matcher/domain/entities/algorithm-settings.ts b/src/modules/matcher/domain/entities/ecosystem/algorithm-settings.ts similarity index 82% rename from src/modules/matcher/domain/entities/algorithm-settings.ts rename to src/modules/matcher/domain/entities/ecosystem/algorithm-settings.ts index 7378baa..aa12abf 100644 --- a/src/modules/matcher/domain/entities/algorithm-settings.ts +++ b/src/modules/matcher/domain/entities/ecosystem/algorithm-settings.ts @@ -1,9 +1,9 @@ -import { IRequestAlgorithmSettings } from '../interfaces/algorithm-settings-request.interface'; -import { DefaultAlgorithmSettings } from '../types/default-algorithm-settings.type'; -import { Algorithm } from '../types/algorithm.enum'; -import { TimingFrequency } from '../types/timing'; -import { ICreateGeorouter } from '../interfaces/georouter-creator.interface'; -import { IGeorouter } from '../interfaces/georouter.interface'; +import { IRequestAlgorithmSettings } from '../../interfaces/algorithm-settings-request.interface'; +import { DefaultAlgorithmSettings } from '../../types/default-algorithm-settings.type'; +import { Algorithm } from '../../types/algorithm.enum'; +import { TimingFrequency } from '../../types/timing'; +import { ICreateGeorouter } from '../../interfaces/georouter-creator.interface'; +import { IGeorouter } from '../../interfaces/georouter.interface'; export class AlgorithmSettings { _algorithmSettingsRequest: IRequestAlgorithmSettings; diff --git a/src/modules/matcher/domain/entities/geography.ts b/src/modules/matcher/domain/entities/ecosystem/geography.ts similarity index 92% rename from src/modules/matcher/domain/entities/geography.ts rename to src/modules/matcher/domain/entities/ecosystem/geography.ts index 2fcfbee..592ef31 100644 --- a/src/modules/matcher/domain/entities/geography.ts +++ b/src/modules/matcher/domain/entities/ecosystem/geography.ts @@ -1,16 +1,16 @@ -import { MatcherException } from '../../exceptions/matcher.exception'; -import { IRequestGeography } from '../interfaces/geography-request.interface'; -import { PointType } from '../types/geography.enum'; -import { Point } from '../types/point.type'; +import { MatcherException } from '../../../exceptions/matcher.exception'; +import { IRequestGeography } from '../../interfaces/geography-request.interface'; +import { PointType } from '../../types/geography.enum'; +import { Point } from '../../types/point.type'; import { find } from 'geo-tz'; import { Route } from './route'; -import { Role } from '../types/role.enum'; -import { IGeorouter } from '../interfaces/georouter.interface'; +import { Role } from '../../types/role.enum'; +import { IGeorouter } from '../../interfaces/georouter.interface'; import { Waypoint } from './waypoint'; import { Actor } from './actor'; import { Person } from './person'; -import { Step } from '../types/step.enum'; -import { Path } from '../types/path.type'; +import { Step } from '../../types/step.enum'; +import { Path } from '../../types/path.type'; export class Geography { _geographyRequest: IRequestGeography; diff --git a/src/modules/matcher/domain/entities/match.ts b/src/modules/matcher/domain/entities/ecosystem/match.ts similarity index 100% rename from src/modules/matcher/domain/entities/match.ts rename to src/modules/matcher/domain/entities/ecosystem/match.ts diff --git a/src/modules/matcher/domain/entities/named-route.ts b/src/modules/matcher/domain/entities/ecosystem/named-route.ts similarity index 100% rename from src/modules/matcher/domain/entities/named-route.ts rename to src/modules/matcher/domain/entities/ecosystem/named-route.ts diff --git a/src/modules/matcher/domain/entities/person.ts b/src/modules/matcher/domain/entities/ecosystem/person.ts similarity index 93% rename from src/modules/matcher/domain/entities/person.ts rename to src/modules/matcher/domain/entities/ecosystem/person.ts index 3a1473f..7340d07 100644 --- a/src/modules/matcher/domain/entities/person.ts +++ b/src/modules/matcher/domain/entities/ecosystem/person.ts @@ -1,4 +1,4 @@ -import { IRequestPerson } from '../interfaces/person-request.interface'; +import { IRequestPerson } from '../../interfaces/person-request.interface'; export class Person { _personRequest: IRequestPerson; diff --git a/src/modules/matcher/domain/entities/requirement.ts b/src/modules/matcher/domain/entities/ecosystem/requirement.ts similarity index 82% rename from src/modules/matcher/domain/entities/requirement.ts rename to src/modules/matcher/domain/entities/ecosystem/requirement.ts index 194907f..40db4c6 100644 --- a/src/modules/matcher/domain/entities/requirement.ts +++ b/src/modules/matcher/domain/entities/ecosystem/requirement.ts @@ -1,4 +1,4 @@ -import { IRequestRequirement } from '../interfaces/requirement-request.interface'; +import { IRequestRequirement } from '../../interfaces/requirement-request.interface'; export class Requirement { _requirementRequest: IRequestRequirement; diff --git a/src/modules/matcher/domain/entities/route.ts b/src/modules/matcher/domain/entities/ecosystem/route.ts similarity index 93% rename from src/modules/matcher/domain/entities/route.ts rename to src/modules/matcher/domain/entities/ecosystem/route.ts index 6712699..d468187 100644 --- a/src/modules/matcher/domain/entities/route.ts +++ b/src/modules/matcher/domain/entities/ecosystem/route.ts @@ -1,5 +1,5 @@ -import { IGeodesic } from '../interfaces/geodesic.interface'; -import { Point } from '../types/point.type'; +import { IGeodesic } from '../../interfaces/geodesic.interface'; +import { Point } from '../../types/point.type'; import { SpacetimePoint } from './spacetime-point'; import { Waypoint } from './waypoint'; diff --git a/src/modules/matcher/domain/entities/spacetime-point.ts b/src/modules/matcher/domain/entities/ecosystem/spacetime-point.ts similarity index 100% rename from src/modules/matcher/domain/entities/spacetime-point.ts rename to src/modules/matcher/domain/entities/ecosystem/spacetime-point.ts diff --git a/src/modules/matcher/domain/entities/time.ts b/src/modules/matcher/domain/entities/ecosystem/time.ts similarity index 93% rename from src/modules/matcher/domain/entities/time.ts rename to src/modules/matcher/domain/entities/ecosystem/time.ts index b3b2ad8..c4a39c5 100644 --- a/src/modules/matcher/domain/entities/time.ts +++ b/src/modules/matcher/domain/entities/ecosystem/time.ts @@ -1,8 +1,8 @@ -import { MatcherException } from '../../exceptions/matcher.exception'; -import { MarginDurations } from '../types/margin-durations.type'; -import { IRequestTime } from '../interfaces/time-request.interface'; -import { TimingDays, TimingFrequency, Days } from '../types/timing'; -import { Schedule } from '../types/schedule.type'; +import { MatcherException } from '../../../exceptions/matcher.exception'; +import { MarginDurations } from '../../types/margin-durations.type'; +import { IRequestTime } from '../../interfaces/time-request.interface'; +import { TimingDays, TimingFrequency, Days } from '../../types/timing'; +import { Schedule } from '../../types/schedule.type'; export class Time { _timeRequest: IRequestTime; diff --git a/src/modules/matcher/domain/entities/waypoint.ts b/src/modules/matcher/domain/entities/ecosystem/waypoint.ts similarity index 83% rename from src/modules/matcher/domain/entities/waypoint.ts rename to src/modules/matcher/domain/entities/ecosystem/waypoint.ts index fb93541..fdcbea0 100644 --- a/src/modules/matcher/domain/entities/waypoint.ts +++ b/src/modules/matcher/domain/entities/ecosystem/waypoint.ts @@ -1,4 +1,4 @@ -import { Point } from '../types/point.type'; +import { Point } from '../../types/point.type'; import { Actor } from './actor'; export class Waypoint { diff --git a/src/modules/matcher/domain/entities/engine/candidate.ts b/src/modules/matcher/domain/entities/engine/candidate.ts new file mode 100644 index 0000000..1a19a59 --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/candidate.ts @@ -0,0 +1,5 @@ +import { Person } from '../ecosystem/person'; + +export class Candidate { + person: Person; +} diff --git a/src/modules/matcher/domain/entities/engine/factory/algorithm-factory.abstract.ts b/src/modules/matcher/domain/entities/engine/factory/algorithm-factory.abstract.ts new file mode 100644 index 0000000..67206e8 --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/factory/algorithm-factory.abstract.ts @@ -0,0 +1,15 @@ +import { MatchQuery } from 'src/modules/matcher/queries/match.query'; +import { Processor } from '../processor.abstract'; +import { Candidate } from '../candidate'; + +export abstract class AlgorithmFactory { + _matchQuery: MatchQuery; + _candidates: Array; + + constructor(matchQuery: MatchQuery) { + this._matchQuery = matchQuery; + this._candidates = []; + } + + abstract createProcessors(): Array; +} diff --git a/src/modules/matcher/domain/entities/engine/factory/classic.ts b/src/modules/matcher/domain/entities/engine/factory/classic.ts new file mode 100644 index 0000000..77a2d04 --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/factory/classic.ts @@ -0,0 +1,9 @@ +import { AlgorithmFactory } from './algorithm-factory.abstract'; +import { Processor } from '../processor.abstract'; +import { ClassicWaypointsCompleter } from '../processor/completer/classic-waypoint.completer.processor'; + +export class ClassicAlgorithmFactory extends AlgorithmFactory { + createProcessors(): Array { + return [new ClassicWaypointsCompleter(this._matchQuery)]; + } +} diff --git a/src/modules/matcher/domain/entities/engine/matcher.ts b/src/modules/matcher/domain/entities/engine/matcher.ts new file mode 100644 index 0000000..bc6da9c --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/matcher.ts @@ -0,0 +1,21 @@ +import { MatchQuery } from '../../../queries/match.query'; +import { Algorithm } from '../../types/algorithm.enum'; +import { Match } from '../ecosystem/match'; +import { Candidate } from './candidate'; +import { AlgorithmFactory } from './factory/algorithm-factory.abstract'; +import { ClassicAlgorithmFactory } from './factory/classic'; + +export class Matcher { + match = (matchQuery: MatchQuery): Array => { + let algorithm: AlgorithmFactory; + switch (matchQuery.algorithmSettings.algorithm) { + case Algorithm.CLASSIC: + algorithm = new ClassicAlgorithmFactory(matchQuery); + } + let candidates: Array = []; + for (const processor of algorithm.createProcessors()) { + candidates = processor.execute(candidates); + } + return []; + }; +} diff --git a/src/modules/matcher/domain/entities/engine/processor.abstract.ts b/src/modules/matcher/domain/entities/engine/processor.abstract.ts new file mode 100644 index 0000000..c5df1a6 --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/processor.abstract.ts @@ -0,0 +1,12 @@ +import { MatchQuery } from 'src/modules/matcher/queries/match.query'; +import { Candidate } from './candidate'; + +export abstract class Processor { + _matchQuery: MatchQuery; + + constructor(matchQuery: MatchQuery) { + this._matchQuery = matchQuery; + } + + abstract execute(candidates: Array): Array; +} diff --git a/src/modules/matcher/domain/entities/engine/processor/completer/classic-waypoint.completer.processor.ts b/src/modules/matcher/domain/entities/engine/processor/completer/classic-waypoint.completer.processor.ts new file mode 100644 index 0000000..b55522a --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/processor/completer/classic-waypoint.completer.processor.ts @@ -0,0 +1,8 @@ +import { Candidate } from '../../candidate'; +import { Completer } from './completer.abstract'; + +export class ClassicWaypointsCompleter extends Completer { + complete(candidates: Array): Array { + return []; + } +} diff --git a/src/modules/matcher/domain/entities/engine/processor/completer/completer.abstract.ts b/src/modules/matcher/domain/entities/engine/processor/completer/completer.abstract.ts new file mode 100644 index 0000000..29f408d --- /dev/null +++ b/src/modules/matcher/domain/entities/engine/processor/completer/completer.abstract.ts @@ -0,0 +1,9 @@ +import { Candidate } from '../../candidate'; +import { Processor } from '../../processor.abstract'; + +export abstract class Completer extends Processor { + execute = (candidates: Array): Array => + this.complete(candidates); + + abstract complete(candidates: Array): Array; +} diff --git a/src/modules/matcher/domain/usecases/match.usecase.ts b/src/modules/matcher/domain/usecases/match.usecase.ts index d80f508..44ce17b 100644 --- a/src/modules/matcher/domain/usecases/match.usecase.ts +++ b/src/modules/matcher/domain/usecases/match.usecase.ts @@ -4,8 +4,8 @@ import { QueryHandler } from '@nestjs/cqrs'; import { Messager } from '../../adapters/secondaries/messager'; import { MatchQuery } from '../../queries/match.query'; import { AdRepository } from '../../adapters/secondaries/ad.repository'; -import { Match } from '../entities/match'; -import { ICollection } from 'src/modules/database/src/interfaces/collection.interface'; +import { Match } from '../entities/ecosystem/match'; +import { ICollection } from '../../../database/src/interfaces/collection.interface'; @QueryHandler(MatchQuery) export class MatchUseCase { diff --git a/src/modules/matcher/queries/match.query.ts b/src/modules/matcher/queries/match.query.ts index 1380c65..b5c62fc 100644 --- a/src/modules/matcher/queries/match.query.ts +++ b/src/modules/matcher/queries/match.query.ts @@ -1,10 +1,10 @@ import { MatchRequest } from '../domain/dtos/match.request'; -import { Geography } from '../domain/entities/geography'; -import { Person } from '../domain/entities/person'; -import { Requirement } from '../domain/entities/requirement'; +import { Geography } from '../domain/entities/ecosystem/geography'; +import { Person } from '../domain/entities/ecosystem/person'; +import { Requirement } from '../domain/entities/ecosystem/requirement'; import { Role } from '../domain/types/role.enum'; -import { AlgorithmSettings } from '../domain/entities/algorithm-settings'; -import { Time } from '../domain/entities/time'; +import { AlgorithmSettings } from '../domain/entities/ecosystem/algorithm-settings'; +import { Time } from '../domain/entities/ecosystem/time'; import { IDefaultParams } from '../domain/types/default-params.type'; import { IGeorouter } from '../domain/interfaces/georouter.interface'; import { ICreateGeorouter } from '../domain/interfaces/georouter-creator.interface'; diff --git a/src/modules/matcher/tests/unit/domain/geography.spec.ts b/src/modules/matcher/tests/unit/domain/ecosystem/geography.spec.ts similarity index 92% rename from src/modules/matcher/tests/unit/domain/geography.spec.ts rename to src/modules/matcher/tests/unit/domain/ecosystem/geography.spec.ts index f616434..e4d20a1 100644 --- a/src/modules/matcher/tests/unit/domain/geography.spec.ts +++ b/src/modules/matcher/tests/unit/domain/ecosystem/geography.spec.ts @@ -1,10 +1,13 @@ -import { Person } from '../../../domain/entities/person'; -import { Geography, RouteKey } from '../../../domain/entities/geography'; -import { Role } from '../../../domain/types/role.enum'; -import { NamedRoute } from '../../../domain/entities/named-route'; -import { Route } from '../../../domain/entities/route'; -import { IGeodesic } from '../../../domain/interfaces/geodesic.interface'; -import { PointType } from '../../../domain/types/geography.enum'; +import { Person } from '../../../../domain/entities/ecosystem/person'; +import { + Geography, + RouteKey, +} from '../../../../domain/entities/ecosystem/geography'; +import { Role } from '../../../../domain/types/role.enum'; +import { NamedRoute } from '../../../../domain/entities/ecosystem/named-route'; +import { Route } from '../../../../domain/entities/ecosystem/route'; +import { IGeodesic } from '../../../../domain/interfaces/geodesic.interface'; +import { PointType } from '../../../../domain/types/geography.enum'; const person: Person = new Person( { diff --git a/src/modules/matcher/tests/unit/domain/person.spec.ts b/src/modules/matcher/tests/unit/domain/ecosystem/person.spec.ts similarity index 93% rename from src/modules/matcher/tests/unit/domain/person.spec.ts rename to src/modules/matcher/tests/unit/domain/ecosystem/person.spec.ts index 56c2e47..c9d604c 100644 --- a/src/modules/matcher/tests/unit/domain/person.spec.ts +++ b/src/modules/matcher/tests/unit/domain/ecosystem/person.spec.ts @@ -1,4 +1,4 @@ -import { Person } from '../../../domain/entities/person'; +import { Person } from '../../../../domain/entities/ecosystem/person'; const DEFAULT_IDENTIFIER = 0; const MARGIN_DURATION = 900; diff --git a/src/modules/matcher/tests/unit/domain/route.spec.ts b/src/modules/matcher/tests/unit/domain/ecosystem/route.spec.ts similarity index 88% rename from src/modules/matcher/tests/unit/domain/route.spec.ts rename to src/modules/matcher/tests/unit/domain/ecosystem/route.spec.ts index 35b6214..16d27a3 100644 --- a/src/modules/matcher/tests/unit/domain/route.spec.ts +++ b/src/modules/matcher/tests/unit/domain/ecosystem/route.spec.ts @@ -1,6 +1,6 @@ -import { Route } from '../../../domain/entities/route'; -import { SpacetimePoint } from '../../../domain/entities/spacetime-point'; -import { Waypoint } from '../../../domain/entities/waypoint'; +import { Route } from '../../../../domain/entities/ecosystem/route'; +import { SpacetimePoint } from '../../../../domain/entities/ecosystem/spacetime-point'; +import { Waypoint } from '../../../../domain/entities/ecosystem/waypoint'; const mockGeodesic = { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/src/modules/matcher/tests/unit/domain/time.spec.ts b/src/modules/matcher/tests/unit/domain/ecosystem/time.spec.ts similarity index 98% rename from src/modules/matcher/tests/unit/domain/time.spec.ts rename to src/modules/matcher/tests/unit/domain/ecosystem/time.spec.ts index 5cc3929..fa5772e 100644 --- a/src/modules/matcher/tests/unit/domain/time.spec.ts +++ b/src/modules/matcher/tests/unit/domain/ecosystem/time.spec.ts @@ -1,4 +1,4 @@ -import { Time } from '../../../domain/entities/time'; +import { Time } from '../../../../domain/entities/ecosystem/time'; const MARGIN_DURATION = 900; const VALIDITY_DURATION = 365;