fix: don't auto assign discounted transport to babies

This commit is contained in:
Björn Fromme
2026-03-16 12:00:55 +01:00
parent 65398d59d4
commit 094d6858d1
2 changed files with 118 additions and 0 deletions
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Form\Service;
use App\BusProNet\Constants;
use App\BusProNet\Utility\DirectionMapper;
use App\Form\Model\BookingDto;
use App\Form\Service\Abstract\AbstractParticipantFieldHandler;
@@ -119,6 +120,12 @@ class ParticipantTransportationDiscountReplacementFieldHandler extends AbstractP
// Step 4b: Handle non-BUS inbound scenario (restore discount if available)
// Inbound is NOT BUS - try to restore discounted PKW if available
// Baby participants never get discounted transportation
$age = $participant->getAge($bookingDto->travel->dateFrom);
if (null !== $age && $age <= Constants::BABY_MAX_AGE) {
return;
}
// Check if outbound is currently REGULAR PKW
$outboundIsRegularPkw = DirectionMapper::isCar($participant->transportationOutbound->subType)
&& (null === $participant->transportationOutbound->price