feat: automatic unselection of discounted transportation

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent 8abab0e379
commit c3fe76d78c
5 changed files with 524 additions and 2 deletions
@@ -844,6 +844,16 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
// If we have both discounted and regular options, apply smart filtering
if (null !== $discountedPkw && null !== $regularPkw) {
// Get participant to check inbound transportation
$participant = $bookingDto->getParticipant($participantIndex);
$inboundIsBus = null !== $participant?->transportationInbound
&& DirectionMapper::SUBTYPE_BUS_API === $participant->transportationInbound->subType;
// If inbound is BUS, always show regular PKW (not discounted)
if ($inboundIsBus) {
return [...$otherServices, $regularPkw];
}
// Check if discounted option is unavailable for this participant (per-booking availability)
$discountedIsUnavailable = $this->serviceAvailabilityCalculator->isServiceUnavailable(
$discountedPkw->id,