feat: delivery areas drawn on a map: the customer pins the address (plan 6R.G)

- services/fees.py: the site's engine (shapes matched by the pin), shared cases
- checkout: price_cart(pin=), delivery_areas with kind (+ geometry for shapes),
  venue_point in the public menu (postcodes and rules stay on the cloud)
- orders: quote / create take lat / lng; online_orders.lat / lng (Alembic 0007),
  sent to the site with the pending orders
- order app: PinMap (Leaflet + OpenStreetMap tiles), 'Pin it on the map' first
  when the venue drew areas, the browser's location offered; lat / lng sent
- tests: cloud test_fees (pinned quote and order), order-app logic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 21:56:13 +02:00
co-authored by Claude Opus 5.5
parent e55157fa86
commit d5b8492512
17 changed files with 406 additions and 41 deletions
+3 -2
View File
@@ -43,8 +43,9 @@ def get_menu(site_slug: str, t: str | None = None, db: Session = Depends(get_db)
import json
data = json.loads(snapshot.snapshot_json)
from services.checkout import delivery_areas
data["delivery_areas"] = delivery_areas(data) # S.3: what the customer picks from
from services.checkout import delivery_areas, venue_point
data["delivery_areas"] = delivery_areas(data) # S.3: what the customer picks from (6R.G: shapes drawn)
data["venue_point"] = venue_point(data) # 6R.G: where the customer's map starts
data.pop("fees", None) # the rules and postcodes stay on the cloud
from services.ordering import summary
data["ordering"] = summary(data) # S.4: services, open now, slots