fix: don't auto assign discounted transport to babies
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user