Plan step 3.4. Owner (2026-11-16): the idle screen is configurable per venue. - routers/customer_display.py (module customer_display, /api/display): the counter POS pushes its state (POST /api/display/state: idle | cart | paid with lines, total, paid, change); only the displays linked to that POS get `display.state`; the last state is kept in memory for a display that reconnects (GET /api/display/state). pos_counter's device scope includes customer_display.state. - The idle screen: setting customer_display.idle (name, logo, logo + name, blank, one image, slideshow, QR code to the online ordering / QR menu / any link; a line of text; dark or light); images uploaded to /app/data/display_media (JPG/PNG/WebP/GIF ≤ 5 MB, random names, served publicly on the LAN); a change sends `display.settings` to every display. New key customer_display.manage (owners, store managers; migration 0022). - Terminal: CustomerDisplayApp (cart with a large total, "Thank you" with the change for 12 s, the venue's idle screen, its theme), logic.js (unit-tested); the POS pushes from the sale cart and the payment dialog (tables, online orders too) via useDisplay(). qrcode.react added to the terminal (already in the workspace). - Manager: Settings → Customer display (style cards, venue name, text, look, slide seconds, QR target/link/caption, image upload/pick/order/delete). - Tests: tests/test_customer_display.py (3), terminal display.test.mjs (3); e2e terminal (linked vs unlinked display, < 1 s, paid, QR and slideshow idle screens), manager (the settings tab). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.7 KiB
Python
37 lines
1.7 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm
|
|
|
|
# Back to the sign-in screen after this many idle minutes (shared screens; 0 = never). Used by
|
|
# the terminal from step 3.1c.
|
|
AUTO_SIGN_OUT = ConfigField('auto_sign_out_minutes', 'int', default=0, choices=(0, 2, 5, 10, 30, 60))
|
|
|
|
# A counter screen's settings (plan step 3.3a): the order type a sale starts as, the receipt
|
|
# printer whose drawer opens on cash payments (used from 3.3b), and the category the product
|
|
# grid opens on (none = all products).
|
|
POS_CONFIG = (
|
|
ConfigField('default_order_type', 'enum', default='takeaway', choices=('takeaway', 'here')),
|
|
ConfigField('start_category_id', 'ref', default=None, choices_from='categories'),
|
|
ConfigField('receipt_printer_id', 'ref', default=None, choices_from='printers'),
|
|
AUTO_SIGN_OUT,
|
|
)
|
|
|
|
MODULE = Module(
|
|
key='pos_counter',
|
|
kind='app',
|
|
name='Counter POS',
|
|
description='A counter terminal for quick sales, tables, price checks and online orders.',
|
|
depends=('ordering',),
|
|
permissions=(
|
|
Perm('pos_counter.access', 'Use the counter POS', roles=('owner', 'store_manager', 'barista', 'barman', 'waiter')),
|
|
),
|
|
limits=(
|
|
Limit('devices', 'Number of counter terminals', free=0, licensed_default=1),
|
|
),
|
|
device_app=DeviceApp(login_modes=('pin', 'tap', 'password'), scope=('pos_counter.*', 'ordering.*', 'connect_orders.*',
|
|
'customer_display.state'), # 3.4: it tells its display what to show
|
|
config=POS_CONFIG),
|
|
routers=(
|
|
Mount('routers.pos', '/api/pos'),
|
|
),
|
|
)
|