- Bell in the header: /api/platform/notifications with unread count, live via
the new LiveProvider (one createLiveClient connection) on platform_notification
and reconnect; mark read / all; warning+critical pop a toast.
- Settings: Sign-in card (manager/waiter/device modes, require username, one
session per manager/waiter, username autofill) replaces the dead v1
security.login_method card; new "Venue & language" tab (language, time zone);
print alert threshold in Printing. Tab labels are i18n keys.
- Technical > Log files: list + download of the daily logs (owner-level).
Backend: GET /api/system/logs, /api/system/logs/{date} (core.settings.manage),
error system.log_not_found.
- Setup wizard asks staff language and time zone (setup/init stores them).
- @xenia/ui theme helpers (applyTheme, getStoredTheme); the manager stays light
until phase 6 converts the older pages (owner decision 2026-11-14).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.1 KiB
Python
25 lines
1.1 KiB
Python
"""The setup wizard sets the venue language and time zone (plan step 2.6f)."""
|
|
import pytest
|
|
|
|
from models.settings import PosSettings
|
|
|
|
|
|
def _setting(db, key):
|
|
row = db.query(PosSettings).filter_by(key=key).first()
|
|
return row.value if row else None
|
|
|
|
|
|
def test_init_sets_language_and_timezone(client, db):
|
|
from models.user import User
|
|
if db.query(User).count():
|
|
pytest.skip("db has users")
|
|
bad = client.post("/api/setup/init", json={"username": "boss", "password": "secret1", "language": "xx"})
|
|
assert bad.json()["error"]["code"] == "validation.unknown_language"
|
|
bad = client.post("/api/setup/init", json={"username": "boss", "password": "secret1", "timezone": "Mars/Base"})
|
|
assert bad.json()["error"]["code"] == "validation.unknown_timezone"
|
|
r = client.post("/api/setup/init", json={"username": "boss", "password": "secret1", "language": "el",
|
|
"timezone": "Europe/Berlin"})
|
|
assert r.status_code in (200, 201), r.text
|
|
db.expire_all()
|
|
assert _setting(db, "venue.language") == "el" and _setting(db, "venue.timezone") == "Europe/Berlin"
|