fix: ensure rental insurance is selectable when insurance is available

addresses #869bp9ev5
This commit is contained in:
Björn Fromme
2026-01-07 17:31:20 +01:00
parent 6fee5c048a
commit ddb876bc1c
3 changed files with 79 additions and 4 deletions
+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,
];