From 5ca5200f1a7dcf259ee379b94c295de6be155915 Mon Sep 17 00:00:00 2001 From: Sylvain Briat Date: Thu, 2 Nov 2023 17:13:16 +0100 Subject: [PATCH 1/2] fix journey value object : useless driver neutral target for passenger start --- .../value-objects/journey.value-object.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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) ); }; From d4412a0cf1928fe47853da029137ba3c38e887cb Mon Sep 17 00:00:00 2001 From: Sylvain Briat Date: Thu, 2 Nov 2023 17:13:29 +0100 Subject: [PATCH 2/2] 1.3.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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,