wip: skipass-duration based rentals filtering

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent ed7c889c4f
commit 1e48e107fc
8 changed files with 288 additions and 17 deletions
@@ -12,6 +12,7 @@ use App\Form\Service\Condition\FieldValueCondition;
use App\Form\Service\Condition\RentalSelectionCondition;
use App\Form\Service\Condition\RoomSelectionCondition;
use App\Form\Service\Condition\ServiceSubTypeCondition;
use App\Form\Service\Condition\SkiPassSelectionCondition;
/**
* Field state provider for the booking create workflow.
@@ -55,6 +56,7 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
protected function registerFieldStateConditions(): void
{
$rentalCondition = new RentalSelectionCondition();
$skiPassCondition = new SkiPassSelectionCondition();
// Hide body dimensions section unless rental services are selected
$this->fieldStateConditions['bodyDimensions'] = [
@@ -73,8 +75,12 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
'hidden' => CompositeCondition::not($dateOfBirthProvidedCondition),
];
// Show rentals only when both date of birth is provided AND skipass is selected
$this->fieldStateConditions['rentals'] = [
'hidden' => CompositeCondition::not($dateOfBirthProvidedCondition),
'hidden' => CompositeCondition::or(
CompositeCondition::not($dateOfBirthProvidedCondition),
CompositeCondition::not($skiPassCondition)
),
];
$this->fieldStateConditions['board'] = [