Locations - aelassas/bookcars GitHub Wiki
BookCars Locations
Locations in BookCars are geographic points used to organize car availability, search, and mapping. They support multilingual names, optional visual and geospatial data, and can contain nested sub-locations and parking spots.
Structure of a Location
Each location consists of the following properties:
-
Image (optional):
Used to visually represent the location on the landing page. -
Country (required):
Indicates the country in which the location resides. -
Parent Location (optional):
Allows locations to be organized hierarchically. Child locations inherit visibility in search. -
Name (Multilingual) (required):
A name must be provided for each supported language. -
Longitude (optional):
Used to position the location on a map. -
Latitude (optional):
Used to position the location on a map. -
Parking Spots (optional):
A list of parking areas associated with the location (see below).
Parking Spots
Parking spots are optional child entities within a location. Each parking spot includes:
- Name (Multilingual) (required)
- Longitude (required)
- Latitude (required)
Parking spots enhance user experience by appearing on the Search and Checkout maps.
Visibility on the Platform
Depending on the data provided, locations appear on various parts of the platform:
Condition | Display Contexts |
---|---|
Has image | Shown in Locations section on the Landing Page |
Has coordinates (longitude + latitude) | Displayed on Maps in the Landing, Locations, Search, and Checkout pages |
Has parking spots | Displayed on Maps in Search and Checkout pages |
Search Behavior
BookCars supports nested location search:
If a user selects a parent location P
that does not have cars, but one of its child locations C
does, cars from C
will appear in the search results for P
.
This enables flexible and intuitive browsing for users who search by broader regions.
Permissions
-
Suppliers can:
- Create and edit their own locations and countries.
- View but not edit locations and countries created by admins or other suppliers.
-
Admins can:
- Manage all locations and countries without restriction.
Summary
Property | Required | Notes |
---|---|---|
Image | ❌ | Enhances UI on landing page |
Country | ✅ | Each location must belong to a country |
Parent Location | ❌ | Enables hierarchical grouping |
Name (All Languages) | ✅ | Ensures localization |
Longitude & Latitude | ❌ | Required for map display |
Parking Spots | ❌ | Adds detailed sub-location info |