feat: selectable drop-offs for inbound bus travel

This commit is contained in:
Björn Fromme
2026-02-17 11:53:39 +01:00
parent 41b0f56b5b
commit 0884a39f3d
31 changed files with 701 additions and 200 deletions
+22 -1
View File
@@ -401,6 +401,15 @@ class BookingEditDraftService
}
}
// Drop-off (single) - merge strategy: only apply if resolves to valid drop-off
if (true === array_key_exists('dropOff', $data) && null !== $data['dropOff']) {
$resolved = $this->resolveDropOff($data['dropOff'], $travel);
if (null !== $resolved) {
$participant->dropOff = $resolved;
$participant->differentDropOff = true;
}
}
// Parking (boolean) - overwrite strategy: user can uncheck
if (true === array_key_exists('parking', $data)) {
$participant->parking = (bool) $data['parking'];
@@ -482,7 +491,19 @@ class BookingEditDraftService
return null;
}
return $travel->pickupsOutbound[$pickupId] ?? $travel->pickupsInbound[$pickupId] ?? null;
return $travel->pickups[$pickupId] ?? $travel->dropOffs[$pickupId] ?? null;
}
/**
* Resolves a drop-off ID to a Pickup object from the travel drop-offs list.
*/
private function resolveDropOff(?int $dropOffId, Travel $travel): ?object
{
if (null === $dropOffId) {
return null;
}
return $travel->dropOffs[$dropOffId] ?? null;
}
/**