fix journey value object : useless driver neutral target for passenger start
This commit is contained in:
parent
62e4015ea7
commit
5ca5200f1a
|
@ -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,
|
||||
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