feat(cloud): online orders keep the delivery area's id for the site's fee check
The site checks the cloud's delivery fee with its own engine when it pulls an order (plan phase 3S, step S.5) and needs the area by id: a name can change between a menu push and the order. New column online_orders.delivery_area_id (migration 0004), set from the priced cart, and in the pending-orders payload (C-4, additive). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,7 @@ def create_order(site_slug: str, body: OnlineOrderCreate, request: Request, db:
|
||||
customer_notes=body.customer_notes,
|
||||
table_label=(body.customer_table or "").strip() or None,
|
||||
delivery_area=priced.area_name,
|
||||
delivery_area_id=priced.area_id,
|
||||
# stored as UTC: SQLite keeps no time zone (read back naive = UTC, schemas mark it)
|
||||
requested_for=(body.requested_for.astimezone(timezone.utc).replace(tzinfo=None)
|
||||
if body.order_type in ("takeaway", "delivery") and body.requested_for else None),
|
||||
|
||||
Reference in New Issue
Block a user