wip: dynamic services fields

This commit is contained in:
Björn Fromme
2025-08-27 17:49:49 +02:00
parent 369d660e24
commit 60b655a195
21 changed files with 634 additions and 39 deletions
@@ -8,6 +8,7 @@ use App\Form\Service\Abstract\AbstractFieldStateProvider;
use App\Form\Service\Condition\CompositeCondition;
use App\Form\Service\Condition\DateOfBirthProvidedCondition;
use App\Form\Service\Condition\RentalSelectionCondition;
use App\Form\Service\Condition\RoomSelectionCondition;
/**
* Field state provider for the booking create workflow.
@@ -83,6 +84,14 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
'hidden' => CompositeCondition::not($dateOfBirthProvidedCondition),
];
// Room-specific field conditions
$mbzRoomCondition = new RoomSelectionCondition(['mbz']);
// Show remarks room field only when room with code 'mbz' is selected
$this->fieldStateConditions['remarksRoom'] = [
'hidden' => CompositeCondition::not($mbzRoomCondition),
];
// Example field state conditions would be registered here
// For demonstration purposes, here are some example patterns: