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:
@@ -186,6 +186,11 @@ try {
|
||||
r.check('devices: the code is normalized as typed (lower case, dash)', await dlg.getByLabel('Code shown on the device').inputValue() === req.code)
|
||||
await dlg.getByLabel('How staff sign in').selectOption('pin')
|
||||
await dlg.getByLabel('Sign out after').selectOption('10')
|
||||
r.check('devices: the kitchen screen settings come in sections, prep zone "All zones" by default (3.2a)',
|
||||
await dlg.locator('[data-config-group]').count() >= 4
|
||||
&& (await dlg.getByLabel('Prep zone').locator('option:checked').textContent()) === 'All zones'
|
||||
&& await dlg.locator('input[type="color"]').count() === 4)
|
||||
await dlg.getByLabel('Text size').fill('110')
|
||||
await dlg.getByRole('button', { name: 'Pair a device' }).click()
|
||||
await page.waitForFunction(() => document.querySelectorAll('[data-testid^="device-"][data-status]').length === 1, null, { timeout: 8000 }).catch(() => {})
|
||||
const row = page.locator('[data-testid^="device-"][data-status]').first()
|
||||
@@ -193,7 +198,7 @@ try {
|
||||
const deviceToken = await devicePicksUpToken(req)
|
||||
const me = await asDevice(deviceToken, '/api/devices/me').then(x => x.json())
|
||||
r.check('devices: the device got its token and runs the kitchen display', me.app_key === 'kds' && me.name === 'Kitchen' && me.login_mode === 'pin', JSON.stringify(me))
|
||||
r.check('devices: the app setting chosen when pairing reaches the device (3.1a)', me.config?.auto_sign_out_minutes === 10, JSON.stringify(me.config))
|
||||
r.check('devices: the app setting chosen when pairing reaches the device (3.1a)', me.config?.auto_sign_out_minutes === 10 && me.config?.font_scale === 110, JSON.stringify(me.config))
|
||||
await page.reload()
|
||||
await row.waitFor({ timeout: 10_000 })
|
||||
r.check('devices: after it connected → "Online", sign-in PIN', await row.getAttribute('data-status') === 'online' && (await row.textContent()).includes('PIN'))
|
||||
|
||||
Reference in New Issue
Block a user