diff --git a/package-lock.json b/package-lock.json index 467d365..d9fde63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mobicoop/matcher", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mobicoop/matcher", - "version": "1.3.0", + "version": "1.3.1", "license": "AGPL", "dependencies": { "@grpc/grpc-js": "^1.9.9", diff --git a/package.json b/package.json index 895eb30..09b8254 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mobicoop/matcher", - "version": "1.3.0", + "version": "1.3.1", "description": "Mobicoop V3 Matcher", "author": "sbriat", "private": true, diff --git a/src/modules/ad/core/domain/value-objects/journey.value-object.ts b/src/modules/ad/core/domain/value-objects/journey.value-object.ts index d36bc9e..836aed9 100644 --- a/src/modules/ad/core/domain/value-objects/journey.value-object.ts +++ b/src/modules/ad/core/domain/value-objects/journey.value-object.ts @@ -38,24 +38,22 @@ export class Journey extends ValueObject { actorTime.target == Target.START, ) as ActorTime, ) as JourneyItem; - const passengerDepartureActorTime = + const passengerDepartureActorTime: ActorTime = passengerDepartureJourneyItem.actorTimes.find( (actorTime: ActorTime) => actorTime.role == Role.PASSENGER && actorTime.target == Target.START, ) as ActorTime; - const driverNeutralActorTime = - passengerDepartureJourneyItem.actorTimes.find( - (actorTime: ActorTime) => - actorTime.role == Role.DRIVER && actorTime.target == Target.NEUTRAL, - ) as ActorTime; + const driverActorTime = passengerDepartureJourneyItem.actorTimes.find( + (actorTime: ActorTime) => actorTime.role == Role.DRIVER, + ) as ActorTime; return ( (passengerDepartureActorTime.firstMinDatetime <= - driverNeutralActorTime.firstMaxDatetime && - driverNeutralActorTime.firstMaxDatetime <= + driverActorTime.firstMaxDatetime && + driverActorTime.firstMaxDatetime <= passengerDepartureActorTime.firstMaxDatetime) || (passengerDepartureActorTime.firstMinDatetime <= - driverNeutralActorTime.firstMinDatetime && - driverNeutralActorTime.firstMinDatetime <= + driverActorTime.firstMinDatetime && + driverActorTime.firstMinDatetime <= passengerDepartureActorTime.firstMaxDatetime) ); };