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
@@ -17,6 +17,7 @@ use App\Form\Service\Condition\FieldValueCondition;
use App\Form\Service\Condition\FinalBookingOnlyCondition;
use App\Form\Service\Condition\FirstParticipantCondition;
use App\Form\Service\Condition\MultipleParticipantsCondition;
use App\Form\Service\Condition\RentalInsuranceAvailableCondition;
use App\Form\Service\Condition\RentalSelectionCondition;
use App\Form\Service\Condition\RoomSelectionCondition;
use App\Form\Service\Condition\ServiceSubTypeCondition;
@@ -264,9 +265,13 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
),
];
// Show rental insurance only when rental services are selected (hidden by default)
// Show rental insurance only when rental services are selected AND LVS services exist (hidden by default)
$rentalInsuranceAvailableCondition = new RentalInsuranceAvailableCondition();
$this->fieldStateConditions['rentalInsurance'] = [
'hidden' => CompositeCondition::not($rentalCondition),
'hidden' => CompositeCondition::or(
CompositeCondition::not($rentalCondition),
CompositeCondition::not($rentalInsuranceAvailableCondition)
),
];
// Show license plate only when parking is selected (hidden by default)