Overview
The Car Sharing functionality in the parking module allows managing zones where the use of parking spaces is conditioned on the reservation being shared.
In this context, certain zones can be configured to only allow reservations in car sharing mode, requiring users to share their vehicle when making a reservation.
How does it work?
The behavior of the “Share car” toggle depends on two configurations:
1. Zone-level configuration (Database)
Each parking zone has a property:
restrictedForCarSharing
This property defines whether the zone is intended for car sharing usage.
true → The zone only allows reservations in car sharing mode
false → The zone allows standard reservations (sharing is not mandatory)
2. Global configuration in the admin panel
In the administration panel, there is a toggle:
“Enable Car Sharing”
This must be activated for the functionality to take effect in the user application.
Behavior in the reservation form
When a user creates a parking reservation:
✅ Case 1: Zone with restrictedForCarSharing = true
(and Car Sharing enabled in the admin panel)
When selecting the zone:
The “Share car” toggle is automatically enabled
The user cannot disable it
The user must complete the guests field in order to proceed with the reservation
👉 In this case, the zone is configured to be used exclusively in shared mode.
❌ Case 2: Zone with restrictedForCarSharing = false
The toggle is not automatically enabled
The user can activate it manually if they wish to share the car
⚠️ Case 3: Car Sharing disabled in admin
Even if the zone has
restrictedForCarSharing = trueThe car sharing functionality will not be available
Summary
Configuration | Form Behavior |
Zone with | Car sharing is mandatory (toggle enabled and locked) |
Zone with | Car sharing is optional |
Car Sharing disabled in admin | Car sharing logic does not apply |
