Platform v2 step 1.11 (APPS_PLATFORM section 10).
- notifications + notification_reads (revision 0010). Text = i18n key notification.<key> + params,
rendered in the reader's language (en, el added).
- core/notifications.py: notify(key, severity, audience, params, dedupe_key, ttl/expires_at, fold)
never raises; audience all_managers | perm:<key> | user:<id>; a live duplicate only bumps
count/last_at (no unread reset, no event). New ones emit WS platform_notification {id} to the
audience's users (current apps ignore it; phase 2 manager shows it).
- API (core, /api/platform/notifications; /api/notifications is chat's): list with unread count,
POST /{id}/read, POST /read-all.
- Producers: license.limit_reached (device pairing/reassign/over-limit device, per module/limit/day,
owners), license.expiring (14/7/3/1 days, from apply_license, owners), support.access_used (each
use, core.settings.manage), print.failed_final (abandoned retry job, per printer/hour, managers).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform v2 step 1.10 (APPS_PLATFORM D-16, section 6.5).
- POST /api/auth/support/challenge (public): an 8-character challenge, stored 15 min
(support_challenges, revision 0009; at most 5 open). POST /api/auth/support/verify
{challenge, code}: code = base32(HMAC(SUPPORT_SECRET, site_id + challenge))[:10];
single use, 5 wrong codes burn the challenge. Opens a 4 h support session
(client=support, synthetic superadmin) with a hard end: sessions.expires_at.
- core/support_codes.py (stdlib only) is the derivation; tools/support_code.py
(--init, --site-secret <SITE_ID>, <SITE_ID> <CHALLENGE>) uses it on the builder's
machine with the master key in %USERPROFILE%/.xenia/support_master_key.txt.
- MASTER_USERNAME/MASTER_PASSWORD removed (config, login, docker-compose.yml,
.env.example); SUPPORT_SECRET added; install.sh asks for it.
- e2e: backends get SUPPORT_SECRET from a test master key and log in with challenge
codes (lib/support.mjs, license_e2e.py); install.mjs expects the new prompt.
- Pack rule CS-15.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform v2 step 1.8 (APPS_PLATFORM D-8, section 6.3).
- devices + device_pair_requests tables (Alembic 0007_devices); sessions.device_id
becomes a FK. Device tokens are stored as sha256 only; the plain token is generated
when the device picks it up, once.
- /api/devices: pair-request (public, rate-limited, LAN-only in the proxy) + polling
with a per-request secret; manager approve/list/rename/config/login mode/link/
reassign/revoke (key core.devices.manage); the device's own /me and /me/users.
- Approving or reassigning checks the app's licence and its `devices` limit
(license.limit_reached); after a downgrade the newest devices beyond the limit are
refused, the oldest keep working.
- X-Xenia-Device: core/access/context.py loads the device (device.not_paired /
device.revoked), tags logs with device=, throttles last_seen_at. check() and
module_required() apply the app's scope (device.out_of_scope); require_device(app).
- POST /api/auth/login {client: "terminal"} uses the device's login mode (device ->
auth.default_login_mode -> app's first mode); tap/none only here. The session is
bound to the device (device.required without its header) and replaces the
device's previous user. Revoke/reassign end the device's sessions.
- Registry: a device app with user logins must declare '<app>.access'.
- Proxy: location /api/devices/pair-request LAN-only on the :443 servers (both copies).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform v2 step 1.6 (APPS_PLATFORM D-8, D-9, §6.2, §6.4).
- sessions table (revision 0006); every JWT carries `sid` and is accepted
only while its session is active (validated per request, 10 s cache that
is dropped the moment a session ends); the in-memory blacklist is gone, so
logout and "end session" survive restarts
- one login path, POST /api/auth/login {client, username?, user_id?, pin?,
password?}: manager mode password|pin (username-only "none" removed, D-8),
waiter mode pin|password|tap (tap answers auth.mode_needs_device until
paired devices exist), optional "waiter must type username", and the app's
access key (core.dashboard.access / waiter_app.access)
- auth.single_session_manager / _waiter: off | refuse_new | end_old
- /login without `client` = the current manager UI with v1 rules (pin or
password; refuse_new treated as end_old because its lock screen re-logs-in);
/login-by-id is a deprecated wrapper for the current waiter app;
/login-no-auth removed
- GET /api/auth/sessions, POST /api/auth/sessions/{id}/end (core.staff.manage);
blocking a user ends their sessions; refresh keeps the session; logout
takes the bearer header (or ?token= as before)
- settings API validates enum/bool/int values from the manifests;
security.login_method migrated to auth.manager_login_mode
- tests: modes, single-session rules, logout, refresh, forged token without
session, manager session list/end
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform v2 step 1.5 (APPS_PLATFORM D-7, D-17, §3, §6.1).
- user_permissions(user_id, key); revision 0005 copies existing v1 flags into
keys (frozen mapping) and drops the perm_* columns; can_cancel_orders gone
- core/access: check() = module effective + key held (superadmin implicit,
override keys wired for 1.9); holds()/can(); markers require/require_any/
public/require_device; role templates from manifests; queries.holders_filter
replaces User.perm_x == True; legacy.py projects/accepts the v1 booleans
for the current manager/waiter UIs only (§3.3, temporary)
- routers.deps: require_manager/... are now aliases of require("<key>");
history endpoints use history.view; superadmin-only = core.system.admin;
get_current_user carries the "signed_in" marker
- every inline perm_* read in routers/services converted to holds()
- staff API: permission catalogue by module with role templates, get/set a
user's keys, reset to role template; legacy flag toggles still work; a
non-superadmin can only grant keys they hold (access.cannot_grant)
- setup wizard creates the first account as owner (v1: store_manager, who
couldn't change settings); demo/seed manager is owner
- roles.py keeps only the role list and labels
- guards: every route has an access marker (19 open routes marked public()
on purpose; /waiters/roles now needs sign-in), no perm_* attribute reads
- tests: check matrix, templates, projection, staff permission API, grant
guard, 0005 data copy; pack rule CS-14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform v2 step 1.2 (APPS_PLATFORM D-12, §3.2, §8).
- core/errors.py: XeniaError + CODES registry; handlers give every error the
{"error": {code, params, message}, "detail"} shape: XeniaError, wrapped
HTTPException (http.<status>, detail untouched), validation.invalid (FastAPI
detail list kept), and internal.error 500 with the request id (body, header
and log line)
- orders: the 18 "Order not found" raises -> XeniaError("order.not_found")
- core/i18n: t(key, lang, **params) with en/el JSON (en fallback), venue/zone/
user language resolution, normalize_language; 56 print keys
- printer_service: every printed label goes through keys. Kitchen,
cancellation and service-item tickets print in the prep zone's language
(-> venue.language); reports/receipts/synopsis in venue.language. Greek
output is unchanged. Print retries now pass the job's zone (language and
item grouping were lost on retries)
- users.language, prep_zones.language (revision 0003), setting venue.language
(default en); editable via PATCH /auth/me, staff update, prep zones API;
"" = inherit
- tests: error shapes, key/placeholder parity, fallback, kitchen ticket per
zone/venue language, language APIs; pack rule CS-12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Snapshot of in-progress work across local_backend, manager_dashboard,
and waiter_pwa (pricing, chat, fiscal, prep zones, recovery codes, CRM,
inventory, permissions), plus the nginx/docker-compose deploy fixes for
the Unraid + NPM reverse-proxy setup.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Includes all work to date:
- local_backend: FastAPI backend with products, orders, tables, shifts, cloud sync
- manager_dashboard: React manager UI with product/category management, reports, settings
- waiter_pwa: React PWA for waiter devices
- Category reparent endpoint and UI
- Waiter domain: local_ip sent on heartbeat, waiter_domain persisted from cloud response
- QR code modal in AppInfoTab for waiter domain
- Product form: number input spinners removed, category pre-selected on new product
- Category row: count badge moved to far right
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>