feat: automatic unselection of discounted transportation
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user