feat(connect): the QR menu at the table: one code per table, orders straight onto the table

Plan phase 3S, step S.7.
- tables.qr_token (migration 0021): a random token per active table; services/table_qr.py
  (tokens, rotate, the snapshot's `qr` with the tokens' sha256 only, the code's link from the
  cloud's apps_url); setting connect_menu.table_ordering (read-only by default).
- /api/connect/qr (connect_menu.manage): the codes, ordering on/off, a new code per table or
  for all; table and QR changes push the menu at once (MENU_PATHS).
- Pull: a QR order with a table id goes onto the table's open order or a new one
  (services/qr_orders.py): items at the cloud's prices, kitchen tickets, KDS, order_updated
  (the waiters' phones and the counter), a `qr_order` message to the order's waiters or the
  table's zone waiters; audit QR_ORDER (a repeated pull adds nothing); the cloud is told
  "accepted" (the guest's page: in the kitchen). No usable table or no open day → the counter
  gets it as before. Waiter app: the message's look.
- Manager: Online → Table QR codes (/online/qr): ordering switch, the menu link, a QR card
  per table (print all), new code per table / for all.
- Heartbeat: apps_url kept in the license state.
- Tests: tests/test_qr_table.py (5); e2e qr_table.mjs (a real cloud and venue: table 5's
  code → two dishes on table 5's order, KDS, live event, the guest's page; a forged code
  refused; a new code kills the old one), in run-all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 01:26:55 +02:00
co-authored by Claude Opus 5.5
parent 70c8f2bb57
commit 652e6a26af
19 changed files with 773 additions and 13 deletions
+21 -1
View File
@@ -45,7 +45,8 @@
"devices": "Συσκευές",
"sessions": "Συνδεδεμένοι τώρα",
"approvals": "Εγκρίσεις υπευθύνου",
"deliveryFees": "Online παραγγελίες (ρύθμιση)"
"deliveryFees": "Online παραγγελίες (ρύθμιση)",
"qrCodes": "QR τραπεζιών"
},
"profile": {
"edit": "Επεξεργασία προφίλ",
@@ -571,5 +572,24 @@
"party": "Μέγιστα άτομα ανά κράτηση",
"fire": "Η κουζίνα παίρνει το φαγητό (λεπτά πριν την άφιξη)",
"fireHint": "0 = την ώρα της κράτησης."
},
"qr": {
"title": "QR κωδικοί τραπεζιών",
"intro": "Κάθε τραπέζι έχει τον δικό του QR κωδικό. Οι πελάτες τον σκανάρουν για να δουν το μενού στο τραπέζι και, αν το επιτρέπετε, να παραγγείλουν: η παραγγελία μπαίνει κατευθείαν στην παραγγελία του τραπεζιού και στην κουζίνα, και οι σερβιτόροι του τραπεζιού παίρνουν μήνυμα.",
"ordering": "Οι πελάτες παραγγέλνουν από το τραπέζι",
"orderingOn": "Ενεργό: οι παραγγελίες μπαίνουν στο τραπέζι και στην κουζίνα.",
"orderingOff": "Ανενεργό: το QR μενού είναι μόνο για ανάγνωση.",
"menuLink": "Το μενού (χωρίς τραπέζι):",
"print": "Εκτύπωση όλων",
"rotateAll": "Νέοι κωδικοί για όλα τα τραπέζια",
"rotate": "Νέος κωδικός",
"rotated": "Το τραπέζι {{name}} έχει νέο κωδικό. Τυπώστε τον και αντικαταστήστε τον παλιό.",
"rotatedAll": "Όλα τα τραπέζια έχουν νέους κωδικούς. Τυπώστε τους και αντικαταστήστε τους παλιούς.",
"rotateAllTitle": "Νέοι κωδικοί για όλα τα τραπέζια;",
"rotateAllBody": "Οι τυπωμένοι κωδικοί σταματούν να ισχύουν σε λίγα δευτερόλεπτα. Θα χρειαστεί να τυπώσετε και να τοποθετήσετε τους νέους.",
"noTables": "Δεν υπάρχουν τραπέζια ακόμα. Προσθέστε πρώτα τραπέζια.",
"table": "Τραπέζι {{name}}",
"scanOrder": "Σκανάρετε για μενού και παραγγελία",
"scanRead": "Σκανάρετε για το μενού"
}
}
+21 -1
View File
@@ -45,7 +45,8 @@
"devices": "Devices",
"sessions": "Signed in now",
"approvals": "Manager approvals",
"deliveryFees": "Online ordering"
"deliveryFees": "Online ordering",
"qrCodes": "Table QR codes"
},
"profile": {
"edit": "Edit profile",
@@ -571,5 +572,24 @@
"party": "Most people per booking",
"fire": "Kitchen gets the food (minutes before arrival)",
"fireHint": "0 = at the booking time."
},
"qr": {
"title": "Table QR codes",
"intro": "Each table has its own QR code. Guests scan it to see the menu at the table, and, if you allow it, to order: the order goes straight onto the table's order and to the kitchen, and the table's waiters get a message.",
"ordering": "Guests can order from the table",
"orderingOn": "On: orders go onto the table's order and to the kitchen.",
"orderingOff": "Off: the QR menu is only for reading.",
"menuLink": "The menu (without a table):",
"print": "Print all codes",
"rotateAll": "New codes for all tables",
"rotate": "New code",
"rotated": "Table {{name}} has a new code. Print it and replace the old one.",
"rotatedAll": "Every table has a new code. Print them and replace the old ones.",
"rotateAllTitle": "New codes for every table?",
"rotateAllBody": "The printed codes stop working within a few seconds. You'll need to print and place the new ones.",
"noTables": "No tables yet. Add tables first.",
"table": "Table {{name}}",
"scanOrder": "Scan to see the menu and order",
"scanRead": "Scan to see the menu"
}
}