wip: conditional mandatory body dimensions

This commit is contained in:
Björn Fromme
2025-07-25 21:47:00 +02:00
parent 9c5597eb23
commit b992e4a5ea
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: