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:
@@ -440,6 +440,9 @@ def store_online_orders(db, orders: list[dict], booked: list | None = None, at_t
|
||||
online_customer_notes=_with_table(cloud_order),
|
||||
online_order_type=cloud_order.get("order_type"),
|
||||
online_delivery_area=cloud_order.get("delivery_area"),
|
||||
# 6R.G: the customer's pin (the delivery's map link)
|
||||
online_lat=(online_check.pin_of(cloud_order) or [None, None])[0],
|
||||
online_lng=(online_check.pin_of(cloud_order) or [None, None])[1],
|
||||
online_price_diff=json.dumps(diff) if diff else None,
|
||||
requested_for=_aware(cloud_order.get("requested_for")),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user