- auth.single_session_waiter gains 'ask', the new default (Alembic 0051 moves venues on 'off'
to it): a second phone gets auth.session_elsewhere {device, since}; Continue retries with
replace=true and the first phone is signed out at once (live session.ended, reason
"replaced") and says why on its sign-in page. Only phones count (terminal sessions are
their own client). refuse_new / end_old unchanged.
- auth.session_ended now carries the reason; the waiter app keeps it until the next sign-in.
- The waiter app sends queued offline ops on every (re)connection, so an order queued on a
phone that was signed out by another goes out after the next sign-in there (e2e checked).
- auth.terminal_require_username (venue) + Device.require_username (per device, wins):
GET /api/devices/me/users lists nobody, the screen asks for a username then PIN/password,
a picked user_id is refused (auth.username_required), "tap" falls back to PIN.
- Manager: Sign-in settings (ask, the new switch), the device dialog's usernames choice.
Plan platform-v2 6F.7.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
5.7 KiB
Python
60 lines
5.7 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import Module, Mount, Perm, SettingDef
|
|
|
|
MODULE = Module(
|
|
key='core',
|
|
kind='core',
|
|
name='Core',
|
|
description='Login, staff, settings, license, system and live updates. Always on.',
|
|
permissions=(
|
|
Perm('core.dashboard.access', 'Open the manager dashboard', roles=('owner', 'store_manager', 'staff_manager')),
|
|
Perm('core.staff.manage', 'Add and edit staff', roles=('owner', 'store_manager', 'staff_manager')),
|
|
Perm('core.settings.manage', 'Change venue settings', roles=('owner',)),
|
|
Perm('core.modules.manage', 'Turn apps, features and integrations on or off', roles=('owner',)),
|
|
Perm('core.devices.manage', 'Pair, rename, reassign and remove devices', roles=('owner', 'store_manager')),
|
|
Perm('core.scenes.manage', 'Make scenes and turn them on or off', roles=('owner', 'store_manager')),
|
|
Perm('core.system.admin', 'Support-only maintenance (superadmin)', roles=()),
|
|
),
|
|
settings=(
|
|
SettingDef('dev.spoof_printing', 'false', 'When enabled, all print jobs are silently dropped. Devices behave as if printing succeeded.', type='bool'),
|
|
SettingDef('security.auto_lock', 'false', "Lock screen after inactivity: 'true' | 'false'", type='bool'),
|
|
SettingDef('security.auto_lock_seconds', '300', 'Seconds of inactivity before locking (0 = disabled)', type='int'),
|
|
SettingDef('security.auto_logout', 'false', "Log out after inactivity: 'true' | 'false'", type='bool'),
|
|
SettingDef('security.auto_logout_seconds', '1800', 'Seconds of inactivity before logging out (0 = disabled)', type='int'),
|
|
SettingDef('security.autofill_username', 'true', "Auto-fill username when only one manager exists: 'true' | 'false'", type='bool'),
|
|
SettingDef('auth.manager_login_mode', 'password', "How managers log in on the dashboard: 'password' | 'pin' (never username-only, D-8)", type='enum', choices=('password', 'pin')),
|
|
SettingDef('auth.waiter_login_mode', 'pin', "How waiters log in: 'pin' | 'password' | 'tap' (tap = pick your name; only on paired devices)", type='enum', choices=('pin', 'password', 'tap')),
|
|
SettingDef('auth.default_login_mode', 'pin', "How staff log in on paired devices (KDS, counter POS) unless the device sets its own: 'pin' | 'password' | 'tap' | 'none'. Apps that can't use it fall back to their first mode.", type='enum', choices=('pin', 'password', 'tap', 'none')),
|
|
SettingDef('auth.waiter_require_username', 'false', 'Waiters must type their username instead of picking their name', type='bool'),
|
|
SettingDef('auth.single_session_manager', 'off', "One manager session per user: 'off' | 'refuse_new' | 'end_old'", type='enum', choices=('off', 'refuse_new', 'end_old')),
|
|
SettingDef('auth.single_session_waiter', 'ask', "One waiter session per user, phones only (no double login): 'off' | 'refuse_new' | 'end_old' | 'ask' (the default: the phone asks, yes signs the other one out)", type='enum', choices=('off', 'refuse_new', 'end_old', 'ask')),
|
|
SettingDef('auth.terminal_require_username', 'false', 'Paired screens (counter, KDS): type a username instead of picking a name; no names are listed, and "tap" is not used. A device can choose otherwise on the Devices page.', type='bool'),
|
|
SettingDef('auth.idle_days', '14', 'Sign people out after this many days without using the app (manager, waiter, paired-device sessions; support has its own 4 h). 0 = never.', type='int'),
|
|
SettingDef('system.log_retention_days', '30', 'Days of daily backend log files to keep in data/logs (default 30). Applied at backend start.', type='int'),
|
|
SettingDef('venue.language', 'en', 'Default language (en | el) for staff without their own language, and for printed reports/receipts and tickets of zones without one.', type='str'),
|
|
SettingDef('venue.timezone', 'Europe/Athens', 'IANA time zone of the venue (e.g. Europe/Athens). All times are shown in it; DST is automatic. Applies immediately.', type='str'),
|
|
SettingDef('venue.name', '', 'Venue name shown on screens and tickets.', type='str'),
|
|
SettingDef('venue.opening_hours', '{}', 'Opening hours, Monday first (6R.15; JSON {days, note}; edited on the Schedule page, shown by signage).', type='json'),
|
|
SettingDef('venue.identity', '{}', "The venue's identity (6R.14): slogan, colours, logos, Wi-Fi, contact details (JSON; Settings > Identity, routers/identity.py).", type='json'),
|
|
SettingDef('venue.theme', 'amber', "Accent colour of the staff apps (the waiter's phones first, plan step 4.6): 'teal' | 'amber' | 'blue' | 'violet' | 'rose', or 'identity' = the first colour of the venue's identity (6R.20: also the counter, KDS and tablets)", type='enum', choices=('teal', 'amber', 'blue', 'violet', 'rose', 'identity')),
|
|
SettingDef('venue.type', '', 'Kind of venue (restaurant, cafe, bar...), chosen in the setup wizard.', type='str'),
|
|
SettingDef('venue.currency', 'EUR', 'ISO 4217 currency of all prices.', type='str'),
|
|
),
|
|
routers=(
|
|
Mount('routers.setup', '/api/setup'),
|
|
Mount('routers.auth', '/api/auth'),
|
|
Mount('routers.waiters', '/api/waiters'),
|
|
Mount('routers.system', '/api/system'),
|
|
Mount('routers.settings', '/api/settings'),
|
|
Mount('routers.ws', '/api/ws'),
|
|
Mount('routers.recovery', '/api/recovery'),
|
|
Mount('routers.devices', '/api/devices'),
|
|
Mount('routers.media', '/api/media'),
|
|
Mount('routers.access', '/api/access'),
|
|
Mount('routers.notifications', '/api/platform/notifications'),
|
|
Mount('routers.scenes', '/api/scenes'),
|
|
Mount('routers.identity', '/api/identity'),
|
|
Mount('core.modules.api', '/api/platform'),
|
|
),
|
|
)
|