Merge branch 'fixJourneyVO' into 'main'
Fix journey vo See merge request v3/service/matcher!15
This commit is contained in:
commit
c5e58db5a6
|
@ -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",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mobicoop/matcher",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"description": "Mobicoop V3 Matcher",
|
||||
"author": "sbriat",
|
||||
"private": true,
|
||||
|
|
|
@ -38,24 +38,22 @@ export class Journey extends ValueObject<JourneyProps> {
|
|||
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)
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue