wip: conditional mandatory body dimensions

This commit is contained in:
Björn Fromme
2026-03-16 11:59:09 +01:00
parent 0f7d95d31b
commit f36c761c28
6 changed files with 207 additions and 10 deletions
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Form\Service;
use App\Form\Service\Abstract\AbstractFieldStateProvider;
use App\Form\Service\Condition\RentalSelectionCondition;
/**
* Field state provider for the booking create workflow.
@@ -44,6 +45,21 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
*/
protected function registerFieldStateConditions(): void
{
$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,
];
// Example field state conditions would be registered here
// For demonstration purposes, here are some example patterns: