fix: ensure rental insurance is selectable when insurance is available

addresses #869bp9ev5
This commit is contained in:
Björn Fromme committed 2026-03-16 12:01:09 +01:00
1 parent ce828a6ef5
commit d7fd273475
3 files changed
+79 -4

No files matched your search

+7 -2
View File
@@ -17,6 +17,7 @@ use App\Form\Service\Condition\FieldValueCondition;
use App\Form\Service\Condition\FirstParticipantCondition;
use App\Form\Service\Condition\PersonalDataMutabilityCondition;
use App\Form\Service\Condition\PickupsMutabilityCondition;
use App\Form\Service\Condition\RentalInsuranceAvailableCondition;
use App\Form\Service\Condition\RentalSelectionCondition;
use App\Form\Service\Condition\RoomSelectionCondition;
use App\Form\Service\Condition\ServiceSubTypeCondition;
@@ -159,9 +160,13 @@ class EditFieldStateProvider extends AbstractFieldStateProvider
'readonly' => $additionalServicesMutabilityCondition,
];
// Rental insurance - shown only when rentals selected, readonly if services not mutable
// Rental insurance - shown only when rentals selected AND LVS services exist, readonly if services not mutable
$rentalInsuranceAvailableCondition = new RentalInsuranceAvailableCondition();
$this->fieldStateConditions['rentalInsurance'] = [
'hidden' => CompositeCondition::not($rentalCondition),
'hidden' => CompositeCondition::or(
CompositeCondition::not($rentalCondition),
CompositeCondition::not($rentalInsuranceAvailableCondition)
),
'readonly' => $additionalServicesMutabilityCondition,
];