wip: transportation services
This commit is contained in:
@@ -4,11 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Form\Service;
|
||||
|
||||
use App\BusProNet\Utility\DirectionMapper;
|
||||
use App\Form\Service\Abstract\AbstractFieldStateProvider;
|
||||
use App\Form\Service\Condition\CompositeCondition;
|
||||
use App\Form\Service\Condition\DateOfBirthProvidedCondition;
|
||||
use App\Form\Service\Condition\FieldValueCondition;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
use App\Form\Service\Condition\RoomSelectionCondition;
|
||||
use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
|
||||
/**
|
||||
* Field state provider for the booking create workflow.
|
||||
@@ -20,6 +23,8 @@ use App\Form\Service\Condition\RoomSelectionCondition;
|
||||
* Current field state conditions:
|
||||
* - Body dimension fields become required when rental services are selected
|
||||
* - Age-dependent service fields are hidden until birth date is provided
|
||||
* - Transportation pickup fields are hidden when transportation type is not BUS
|
||||
* - Parking field is hidden when outbound transportation is not PKW
|
||||
*/
|
||||
class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
{
|
||||
@@ -92,6 +97,24 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
'hidden' => CompositeCondition::not($mbzRoomCondition),
|
||||
];
|
||||
|
||||
// Transportation-related field conditions
|
||||
|
||||
// Hide outbound pickup when transportation is not BUS
|
||||
$this->fieldStateConditions['pickupOutbound'] = [
|
||||
'hidden' => ServiceSubTypeCondition::notEquals('transportationOutbound', DirectionMapper::SUBTYPE_BUS_API),
|
||||
];
|
||||
|
||||
// Hide inbound pickup when transportation is not BUS
|
||||
$this->fieldStateConditions['pickupInbound'] = [
|
||||
'hidden' => ServiceSubTypeCondition::notEquals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API),
|
||||
];
|
||||
|
||||
// Hide parking when outbound transportation is not PKW (car)
|
||||
// Parking is offered at holiday destination for those arriving by car
|
||||
$this->fieldStateConditions['parking'] = [
|
||||
'hidden' => ServiceSubTypeCondition::notEquals('transportationOutbound', DirectionMapper::SUBTYPE_CAR_API),
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
// For demonstration purposes, here are some example patterns:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user