Seasonal restricted zones (the Hajj season in Makkah)
Built: 2026-11-02. Written for operators and for whoever maintains the code.
During the Hajj season, Saudi Arabia's Transport General Authority tells operators not to carry passengers into Makkah and the holy sites unless the passenger holds one of:
- a Hajj permit;
- a work entry permit;
- a Makkah-residence entry permit.
In 2025 the season ran from 29 April to 10 June. Pilgrims without a permit can be fined up to SAR 20,000, and vehicles carrying them can be confiscated.
RideKit now supports this with two additions:
- any zone can be dated (active from / until);
- a restricted zone can say what happens to drop-offs inside it, with a permit exemption.
Legal note. The authority announces the dates and the rules each year. Check them before every season, and confirm with local counsel how the permit should be verified.
Setting it up
Admin → Zones → Draw new zone. Draw Makkah and the holy sites (or edit an existing zone). Type: Restricted.
Under What this zone restricts, press Fill Hajj season (Makkah). This sets:
Setting Value Refuse pickups inside off (people may leave Makkah freely) Drop-offs inside Not allowed Allow riders who hold a permit on What the permit is called "a Hajj permit or Makkah residence" Optionally, add a Message for riders and drivers, such as the authority's notice.
Under Season, set From and Until in the market's own clock (Asia/Riyadh). The Umm al-Qura (Hijri) date shows under each, because the season moves every year.
Save. The zone list shows "Until 10 Jun 2026" and "Drop-offs need a permit". Before the start it shows "Starts …", and after the end "Season over".
Other combinations
| Drop-offs inside | Permit exemption | What happens |
|---|---|---|
| Allowed | n/a | Nothing changes for drop-offs. This is what every restricted zone did before. |
| Allowed, with a warning | n/a | The rider sees a notice and may book. |
| Not allowed | off | The booking is refused. |
| Not allowed | on | The rider must declare the permit to book. |
Seasons apply to service, restricted, surge, airport and region zones. Toll gates, metro stations and airport holding areas ignore them.
What happens
Rider. On the confirm screen, before Book, the rider sees one of:
- Permit zone: "Trips to Makkah need a Hajj permit or Makkah residence until 10 June." It is followed by the operator's message and a checkbox: "I hold a Hajj permit or Makkah residence. The driver may ask to see it." Book stays disabled until the box is ticked.
- Blocked zone: "Drop-offs in … can't be booked until …". Book stays disabled.
- Warning zone: the notice only.
Stops are checked as well as the drop-off. The strictest zone wins.
Server. The booking enforces the same rules, so an old app cannot get round them:
dropoff_restricted: the drop-off is blocked.dropoff_permit_required: the drop-off needs a permit and none was declared.
The apps translate both codes. A declared permit is stored on the ride
(rides.permit_declared).
Driver.
- Home screen, while a season is in force: "Makkah: passenger trips need a Hajj permit or Makkah residence until 10 June", with the operator's message.
- The offer, before accepting: "Rider declared: a Hajj permit or Makkah residence".
- The trip screen, until pickup: "Before setting off, check that the rider holds: a Hajj permit or Makkah residence. The drop-off is permit-only this season."
All dates show in the market's time zone, not the phone's.
Not covered
- Verifying the permit. The app records the rider's declaration and asks the driver to check it. There is no check against the authority's permit system (none is public).
- Small-vehicle bans. The ban on small vehicles entering Makkah in peak season is not modelled by vehicle type. Use a blocked zone if it applies to every ride type.
- One wording per language. The permit name and the message are shown as the operator typed them. In Saudi Arabia, write them in the language most riders read, or both ("تصريح حج / Hajj permit").
- Repeating seasons. Dates are set per season. A rule keyed to Hijri dates that repeats every year is not built.
For maintainers
| Area | Files |
|---|---|
| Rules (pure) | backend/src/geo/restricted-rules.ts: parseRestrictedRules, restrictedRulesOf, dropoffProblem, zoneInSeason |
| Storage | Migration 1700000132000-SeasonalZones.ts: zones.active_from/active_to, rides.permit_declared |
| Geo | GeoService.restrictionsAt, seasonalRestrictions; seasons in zonesAt, regionsAt, isServiceable; pickup refusal reads rules.pickup |
| API | GET /geo/restrictions?lat&lng, GET /geo/restrictions/seasonal; zone create/update take activeFrom / activeTo |
| Booking | RidesService.book (stops and drop-off), BookRideDto.permitDeclared; the offer carries permitDeclared |
| Admin | zones/RestrictedFields.tsx (RestrictedFields, SeasonFields), zones/restricted-form.ts (HAJJ_PRESET, hijriDate, seasonState), lib/datetime.ts instantToMarketWall |
| Rider | src/lib/restrictions.ts; the confirm-screen card and Book gating |
| Driver | SeasonalRestrictionBanner.tsx on home; OfferSheet badge; trip.tsx banner |
| Tests | geo/restricted-rules.spec.ts, admin zones/restricted-form.test.ts, rider lib/restrictions.test.ts |