wip: implement transportation, pickups and parking
This commit is contained in:
@@ -23,8 +23,8 @@ use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
* 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
|
||||
* - Transportation pickup fields are hidden by default, shown only when transportation type is BUS
|
||||
* - Parking field is hidden by default, shown only when outbound transportation is PKW
|
||||
*/
|
||||
class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
{
|
||||
@@ -99,20 +99,26 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
|
||||
// Transportation-related field conditions
|
||||
|
||||
// Hide outbound pickup when transportation is not BUS
|
||||
// Show outbound pickup only when transportation is BUS (hidden by default)
|
||||
$this->fieldStateConditions['pickupOutbound'] = [
|
||||
'hidden' => ServiceSubTypeCondition::notEquals('transportationOutbound', DirectionMapper::SUBTYPE_BUS_API),
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
),
|
||||
];
|
||||
|
||||
// Hide inbound pickup when transportation is not BUS
|
||||
// Show inbound pickup only when transportation is BUS (hidden by default)
|
||||
$this->fieldStateConditions['pickupInbound'] = [
|
||||
'hidden' => ServiceSubTypeCondition::notEquals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API),
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
),
|
||||
];
|
||||
|
||||
// Hide parking when outbound transportation is not PKW (car)
|
||||
// Show parking only when outbound transportation is PKW (hidden by default)
|
||||
// Parking is offered at holiday destination for those arriving by car
|
||||
$this->fieldStateConditions['parking'] = [
|
||||
'hidden' => ServiceSubTypeCondition::notEquals('transportationOutbound', DirectionMapper::SUBTYPE_CAR_API),
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_CAR_API)
|
||||
),
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
|
||||
Reference in New Issue
Block a user