wip: rentals insurance field

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 3063a7c05f
commit b84997d058
13 changed files with 315 additions and 83 deletions
+9 -12
View File
@@ -21,7 +21,7 @@ use App\Form\Service\Condition\ServiceSubTypeCondition;
* state functionality provided by AbstractFieldStateProvider.
*
* Current field state conditions:
* - Body dimension fields become required when rental services are selected
* - Body dimension fields are hidden unless rental services are selected
* - Age-dependent service fields are hidden until birth date is provided
* - Transportation pickup fields are hidden by default, shown only when transportation type is BUS
* - Parking field is hidden by default, shown only when outbound transportation is PKW
@@ -56,17 +56,9 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
{
$rentalCondition = new RentalSelectionCondition();
// Make body dimension fields required when rental services are selected
$this->fieldStateConditions['height'] = [
'required' => $rentalCondition,
];
$this->fieldStateConditions['weight'] = [
'required' => $rentalCondition,
];
$this->fieldStateConditions['shoeSize'] = [
'required' => $rentalCondition,
// Hide body dimensions section unless rental services are selected
$this->fieldStateConditions['bodyDimensions'] = [
'hidden' => CompositeCondition::not($rentalCondition),
];
// Hide age-dependent fields when no date of birth is provided
@@ -121,6 +113,11 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
),
];
// Show rental insurance only when rental services are selected (hidden by default)
$this->fieldStateConditions['rentalInsurance'] = [
'hidden' => CompositeCondition::not($rentalCondition),
];
// Example field state conditions would be registered here
// For demonstration purposes, here are some example patterns: