feat(backend): KDS settings as device config, zone enforced for kitchen screens, KDS-only API (platform-v2 3.2a)
- KDS manifest: 23 typed settings (prep zone, board, waiting-time minutes and colours,
behaviour) replacing the KDS page's localStorage settings.
- ConfigField: colour type, "after" ordering (warning < late < flash), groups for the
manager's dialogs, ".none" text for an empty ref choice.
- routers/kds.py: a KDS device gets only its zone's orders, prints to its zone by default
and signs waiter messages with its zone/name. New GET /api/kds/context and
POST /api/kds/orders/{id}/retry-print so the screen never leaves its kds.* scope.
Unused v1 /items and /items/{id}/status endpoints removed (D-21).
- PATCH /api/devices/me/config: a screen changes its own settings when the signed-in
person holds core.devices.manage.
- Manager Devices dialogs: settings in sections, colour pickers, "All zones".
- Tests: test_kds_device.py, colour/ordered fields; terminal.mjs scope + zone checks;
manager.mjs settings sections; stack.mjs detaches the non-LAN network before the
restart check (one flaky 403).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,8 @@ def test_every_permission_has_a_label(lang):
|
||||
|
||||
@pytest.mark.parametrize("lang", ["en", "el"])
|
||||
def test_every_device_config_field_has_texts(lang):
|
||||
"""modules:<app>.config.<key>.label, and .choices.<value> for every choice (plan step 3.1a)."""
|
||||
"""modules:<app>.config.<key>.label, .choices.<value> for every choice (3.1a), .none for a
|
||||
ref field's empty choice and config_groups.<group> for every group (3.2a)."""
|
||||
texts = json.loads((LOCALES / lang / "modules.json").read_text(encoding="utf-8"))
|
||||
missing, known = [], set()
|
||||
for m in registry().values():
|
||||
@@ -61,6 +62,10 @@ def test_every_device_config_field_has_texts(lang):
|
||||
for c in f.choices:
|
||||
if not t.get("choices", {}).get(str(c)):
|
||||
missing.append(f"{m.key}.config.{f.key}.choices.{c}")
|
||||
if f.type == "ref" and not t.get("none"):
|
||||
missing.append(f"{m.key}.config.{f.key}.none")
|
||||
if f.group and not texts.get(m.key, {}).get("config_groups", {}).get(f.group):
|
||||
missing.append(f"{m.key}.config_groups.{f.group}")
|
||||
known.add((m.key, f.key))
|
||||
assert missing == []
|
||||
extra = {(mod, k) for mod, t in texts.items() for k in t.get("config", {})} - known
|
||||
|
||||
Reference in New Issue
Block a user