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
+4
View File
@@ -125,6 +125,10 @@ def setup_init(body: SetupInitRequest, db: Session = Depends(get_db)):
else:
db.add(PosSettings(key="venue.type", value=body.venue_type, updated_at=now))
from services.defaults import seed_starter_content # table flags + quick messages (KI-007)
from core.sessions import _setting
seed_starter_content(db, body.language or _setting(db, "venue.language", "en"))
db.commit()
if body.language or body.timezone:
i18n.invalidate()