wip: skipass-duration based rentals filtering
This commit is contained in:
@@ -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'] = [
|
||||
|
||||
Reference in New Issue
Block a user