feat(waiter): where each line came from; QR lines marked, the QR message opens the table (platform-v2 step 4.8b)
- order_items.source (Alembic 0025): waiter | counter | qr | online, set by the server (orders.add_priced_items: the phone / manager 'waiter', the counter 'counter'; the QR menu's lines 'qr', online orders 'online'; a split line keeps its source); lines of existing online orders backfilled 'online'; in the order's item output. - Waiter: lines the guests sent from the QR menu (or an online order) carry a "📱 QR" / "🌐 Online" mark; the qr_order message's banner has "Open the table", and in the bell's list the message opens it. - Tests: source per channel, migration 0025, QR placement marks 'qr'; waiter e2e +1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -377,6 +377,8 @@ def get_order(order_id: int, db: Session = Depends(get_db), user: User = Depends
|
||||
"price_adjustment": getattr(i, 'price_adjustment', 0.0) or 0.0,
|
||||
"unit_type": i.unit_type,
|
||||
"system_key": i.system_key, # the delivery fee line (phase 3S, S.5)
|
||||
"source": i.source, # waiter | counter | qr | online (4.8)
|
||||
"course_id": i.course_id,
|
||||
}
|
||||
|
||||
def fmt_log(l):
|
||||
@@ -711,6 +713,7 @@ def add_priced_items(order_id: int, body: AddItemsRequest, db: Session, user: Us
|
||||
removed_ingredients=json.dumps(item_in.removed_ingredients) if item_in.removed_ingredients else None,
|
||||
notes=item_in.notes,
|
||||
course_id=item_in.course_id,
|
||||
source=item_in.source or "waiter",
|
||||
)
|
||||
db.add(item)
|
||||
db.flush()
|
||||
@@ -1613,6 +1616,7 @@ def split_item(
|
||||
|
||||
# Create split-off item
|
||||
new_item = OrderItem(
|
||||
source=item.source,
|
||||
order_id=order_id,
|
||||
product_id=item.product_id,
|
||||
added_by=item.added_by,
|
||||
|
||||
Reference in New Issue
Block a user