diff --git a/src/modules/ad/core/application/queries/match/completer/passenger-oriented-waypoints.completer.ts b/src/modules/ad/core/application/queries/match/completer/passenger-oriented-waysteps.completer.ts similarity index 91% rename from src/modules/ad/core/application/queries/match/completer/passenger-oriented-waypoints.completer.ts rename to src/modules/ad/core/application/queries/match/completer/passenger-oriented-waysteps.completer.ts index c281177..339c5a6 100644 --- a/src/modules/ad/core/application/queries/match/completer/passenger-oriented-waypoints.completer.ts +++ b/src/modules/ad/core/application/queries/match/completer/passenger-oriented-waysteps.completer.ts @@ -11,7 +11,7 @@ import { WayStepsCreator } from '@modules/ad/core/domain/waysteps-creator.servic /** * Complete candidates by setting driver and crew waypoints */ -export class PassengerOrientedWaypointsCompleter extends Completer { +export class PassengerOrientedWayStepsCompleter extends Completer { complete = async ( candidates: CandidateEntity[], ): Promise => { @@ -54,11 +54,6 @@ export class PassengerOrientedWaypointsCompleter extends Completer { ); candidate.setWaySteps(carpoolPathCreator.getCrewCarpoolPath()); }); - // console.log( - // candidates[0] - // .getProps() - // .waySteps?.map((waystep: WayStep) => waystep.actors), - // ); return candidates; }; } diff --git a/src/modules/ad/core/application/queries/match/passenger-oriented-algorithm.ts b/src/modules/ad/core/application/queries/match/passenger-oriented-algorithm.ts index 8ca7147..b06faf0 100644 --- a/src/modules/ad/core/application/queries/match/passenger-oriented-algorithm.ts +++ b/src/modules/ad/core/application/queries/match/passenger-oriented-algorithm.ts @@ -1,6 +1,6 @@ import { Algorithm } from './algorithm.abstract'; import { MatchQuery } from './match.query'; -import { PassengerOrientedWaypointsCompleter } from './completer/passenger-oriented-waypoints.completer'; +import { PassengerOrientedWayStepsCompleter } from './completer/passenger-oriented-waysteps.completer'; import { PassengerOrientedGeoFilter } from './filter/passenger-oriented-geo.filter'; import { AdRepositoryPort } from '../../ports/ad.repository.port'; import { PassengerOrientedSelector } from './selector/passenger-oriented.selector'; @@ -13,7 +13,7 @@ export class PassengerOrientedAlgorithm extends Algorithm { super(query, repository); this.selector = new PassengerOrientedSelector(query, repository); this.processors = [ - new PassengerOrientedWaypointsCompleter(query), + new PassengerOrientedWayStepsCompleter(query), new PassengerOrientedGeoFilter(query), ]; } diff --git a/src/modules/ad/tests/unit/core/passenger-oriented-waypoints-completer.spec.ts b/src/modules/ad/tests/unit/core/passenger-oriented-waysteps-completer.spec.ts similarity index 87% rename from src/modules/ad/tests/unit/core/passenger-oriented-waypoints-completer.spec.ts rename to src/modules/ad/tests/unit/core/passenger-oriented-waysteps-completer.spec.ts index 9700b77..d840b7e 100644 --- a/src/modules/ad/tests/unit/core/passenger-oriented-waypoints-completer.spec.ts +++ b/src/modules/ad/tests/unit/core/passenger-oriented-waysteps-completer.spec.ts @@ -1,4 +1,4 @@ -import { PassengerOrientedWaypointsCompleter } from '@modules/ad/core/application/queries/match/completer/passenger-oriented-waypoints.completer'; +import { PassengerOrientedWayStepsCompleter } from '@modules/ad/core/application/queries/match/completer/passenger-oriented-waysteps.completer'; import { MatchQuery } from '@modules/ad/core/application/queries/match/match.query'; import { AlgorithmType } from '@modules/ad/core/application/types/algorithm.types'; import { Waypoint } from '@modules/ad/core/application/types/waypoint.type'; @@ -75,10 +75,10 @@ const candidates: CandidateEntity[] = [ }), ]; -describe('Passenger oriented waypoints completer', () => { +describe('Passenger oriented waysteps completer', () => { it('should complete candidates', async () => { - const passengerOrientedWaypointsCompleter: PassengerOrientedWaypointsCompleter = - new PassengerOrientedWaypointsCompleter(matchQuery); + const passengerOrientedWaypointsCompleter: PassengerOrientedWayStepsCompleter = + new PassengerOrientedWayStepsCompleter(matchQuery); const completedCandidates: CandidateEntity[] = await passengerOrientedWaypointsCompleter.complete(candidates); expect(completedCandidates.length).toBe(2);