feat: hide parking from participants under 18
This commit is contained in:
@@ -6,6 +6,7 @@ namespace App\Form\Service;
|
||||
|
||||
use App\BusProNet\Utility\DirectionMapper;
|
||||
use App\Form\Service\Abstract\AbstractFieldStateProvider;
|
||||
use App\Form\Service\Condition\AgeRangeCondition;
|
||||
use App\Form\Service\Condition\ApplicantCondition;
|
||||
use App\Form\Service\Condition\AuthenticatedUserPersonalDataCondition;
|
||||
use App\Form\Service\Condition\BabyAgeCondition;
|
||||
@@ -250,11 +251,16 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
),
|
||||
];
|
||||
|
||||
// Show parking only when outbound transportation is PKW (hidden by default)
|
||||
// Show parking only when outbound transportation is PKW AND participant is 18+ (hidden by default)
|
||||
// Parking is offered at holiday destination for those arriving by car
|
||||
// Participants under 18 cannot drive in Germany, so parking is not relevant for them
|
||||
$minimumDrivingAgeCondition = new AgeRangeCondition(18);
|
||||
$this->fieldStateConditions['parking'] = [
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_CAR_API)
|
||||
'hidden' => CompositeCondition::or(
|
||||
CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_CAR_API)
|
||||
),
|
||||
CompositeCondition::not($minimumDrivingAgeCondition)
|
||||
),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user