fix: orders CSV export, Online Orders live refresh, starter flags and quick messages

Cleanup before platform-v2 phase 3 (owner-approved).
- KI-008: GET /api/reports/orders/export read order_history's dicts as ORM rows and
  always failed with 500; it also ignored business_day_id (the Today page sends it).
  Rebuilt on the dicts, header even when empty. tests/test_reports_export.py.
- KI-010: OnlineOrdersPage listened on /api/stream (never existed: no live refresh,
  a 404 every few seconds). It now refetches on the shared live connection
  (online_order_received / online_order_updated / ready); 20 s polling stays as a
  fallback. manager.mjs checks nothing asks for /api/stream.
- KI-007: the setup wizard seeds the 10 default table flags and 5 quick messages in
  the venue language (services/defaults.py), only when none exist. v1's seed never
  worked (NOT NULL columns missing). Managers edit them in Settings -> Operation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 14:08:54 +02:00
co-authored by Claude Opus 5.5
parent f1f20f7bba
commit 034426f870
7 changed files with 158 additions and 33 deletions
+10
View File
@@ -464,6 +464,16 @@ try {
await page.keyboard.press('Escape')
const settingValue = async key => (await api('GET', '/api/settings/', { token: boss }))[key].value
// KI-010: Online Orders refreshes from the shared live connection, never /api/stream
const ooUrls = []
const ooListen = req => ooUrls.push(new URL(req.url()).pathname)
page.on('request', ooListen)
await page.goto(`${APP}/online-orders`)
await sleep(5000)
page.off('request', ooListen)
r.check('online orders: loads its lists and never asks for the old /api/stream',
ooUrls.some(u => u.startsWith('/api/connect/orders')) && !ooUrls.some(u => u.startsWith('/api/stream')), [...new Set(ooUrls)].filter(u => u.startsWith('/api/')).join(' '))
await page.goto(`${APP}/settings`)
await page.getByText('Sign-in & security', { exact: true }).click()
const waiterMode = page.getByTestId('setting-auth.waiter_login_mode')