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:
@@ -54,7 +54,7 @@ class SettingDef:
|
||||
choices: tuple[str, ...] = () # for type "enum"
|
||||
|
||||
|
||||
ConfigType = Literal["bool", "int", "str", "enum", "ref"]
|
||||
ConfigType = Literal["bool", "int", "str", "enum", "ref", "color"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -62,7 +62,8 @@ class ConfigField:
|
||||
"""One setting of a device running an app (plan step 3.1a). Stored in devices.config,
|
||||
validated by core/modules/device_config.py, edited in the manager's pair/edit dialogs.
|
||||
Texts: modules:<app>.config.<key>.label (+ .hint optional, + .choices.<value> for each
|
||||
choice), checked by tests/test_module_texts.py."""
|
||||
choice, + .none for a ref's empty choice; groups: modules:<app>.config_groups.<group>),
|
||||
checked by tests/test_module_texts.py."""
|
||||
key: str
|
||||
type: ConfigType
|
||||
default: object = None
|
||||
@@ -70,6 +71,8 @@ class ConfigField:
|
||||
min: Optional[int] = None # int
|
||||
max: Optional[int] = None # int
|
||||
choices_from: Optional[str] = None # ref: "prep_zones" | "devices:<app_key>"; value = id or None
|
||||
group: Optional[str] = None # section in the manager's dialogs (3.2a)
|
||||
after: Optional[str] = None # int: must be greater than this other field (age thresholds)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
Reference in New Issue
Block a user