feat: delivery areas drawn on a map (plan 6R.G)

An area is a list of postcodes, a shape drawn on a map or a circle around a
point. The fee engine (both copies, byte-identical) matches a shape only by
the customer's pin, then postcodes; point-in-polygon (edges inside) and
haversine circles; shared cases in fee_cases.json.

- Alembic 0053: delivery_areas.kind / geometry, orders.online_lat / lng
- /api/connect/fees: areas with kind + geometry (validated: 3-200 corners,
  50 m - 50 km), the venue's place (PUT /venue-point, setting venue.location,
  sent to the cloud as fees.venue_point), preview by lat / lng
- manager: DeliveryMap (Leaflet + OpenStreetMap tiles): draw / move / remove
  corners, circles, the venue on the map, an overview, test an order by a point
- pulled online orders keep the pin; the site re-checks the fee with it;
  the counter links the pin to a map
- tests: backend (shapes, venue point, pinned orders), manager logic,
  e2e manager.mjs and order_app.mjs 6R.G blocks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 21:55:36 +02:00
co-authored by Claude Opus 5.5
parent 0840247768
commit 6f42e00684
25 changed files with 844 additions and 40 deletions
+31 -1
View File
@@ -1047,7 +1047,37 @@
"refused": {
"minimum_not_met": "Refused: the minimum order is {{minimum}}.",
"area_not_served": "Refused: no delivery to this address."
}
},
"areaKind": "Where it is",
"kind": {
"postcodes": "Postcodes",
"polygon": "Drawn on the map",
"circle": "Circle around a point"
},
"drawHint": "Tap the map to add a corner. Drag a corner to move it; tap a corner to remove it. The shape closes by itself.",
"corners_one": "{{count}} corner",
"corners_other": "{{count}} corners",
"undoCorner": "Undo the last corner",
"clearShape": "Start again",
"circleHint": "Tap the map or drag the dot to place the centre; type how far out it reaches.",
"radius": "Reaches out to",
"radiusHint": "Metres from the centre ({{distance}}); 50 m to 50 km.",
"areaProblem": {
"corners": "Draw at least 3 corners on the map.",
"centre": "Tap the map to place the circle's centre.",
"radius": "The distance is 50 m to 50 km."
},
"venueOnMap": "The venue on the map",
"venueHint": "Tap the map where the venue is. The customers' map starts here and a new circle is drawn around it.",
"venueClear": "Remove the venue's place",
"venueSet": "The venue's place on the map is set.",
"venueNotSet": "The venue's place on the map isn't set yet: the customers' map then starts at the areas you draw.",
"venueMove": "Move it",
"venueSetButton": "Set it on the map",
"areaDrawn_one": "Drawn on the map · {{count}} corner",
"areaDrawn_other": "Drawn on the map · {{count}} corners",
"areaCircle": "Within {{distance}} of a point",
"testByPoint": "A point on the map"
},
"ordering": {
"pageTitle": "Online ordering",