terminal/src/apps/menu-tablet: the venue's menu for staff (a quick price
check) and guests. Category chips that jump to their section, or one A–Z
list; compact rows, expanded rows (photo, description) or full cards; tap a
product to see it big (photo, price, description, tags); search that ignores
accents and also finds names typed in Latin letters ("souvl"); sold out
marked; the guest's language for the tablet's texts; back to the start (search
cleared, first language, top) after the set time without a touch; light or
dark; the last menu kept for offline; live on menu_tablet.changed /
device.updated. @xenia/i18n exports ./latin for plain-JS use.
tests: logic (3), e2e menu_tablet.mjs (10 checks, in run-all).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signage gets tabs:
- Screens: every paired signage TV with what it plays (a playlist, or a
schedule that wins over it), its shape and rotation, a warning when a
playlist was made for the other shape; a link to pair one in Devices.
- Schedules: lines (a playlist on days / between hours that may pass midnight /
between dates, with a priority) and the playlist for the rest of the time;
"now: …" per schedule; the screens on it.
- Message and weather: the message of the day for every screen; the
weather's town from a search (°C / °F), now / fetched at, "no forecast"
when the server can't reach the service, fetch now, remove; says the
weather needs internet and the widget hides without it.
- e2e signage.mjs +6 (message saved, weather section, choosing a playlist and
turning the picture move the TV, a schedule built in the manager plays what
it picks now); a crash is reported as a failed check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Menu board: everything or chosen whole categories (sub-categories
included, new products join) plus single products found by search; hide a
product from the board (and show it again); the board's own order with
arrows on what the server resolved (categories and products; boardOrder
writes it); a badge per product; grouping, headings, photos, descriptions,
whose prices (a sales point or none), sold out crossed out or hidden,
columns, products per page (or as many as fit), seconds per page; colours,
font, size, background.
- Widgets (text and menu slides): logo, venue name, date (long / short),
clock (seconds), message of the day (or its own text), QR code (ordering /
QR menu / a link + caption), weather (1-3 days, says it needs internet);
where (corners, bars) and size.
- The preview stays in view while the settings scroll.
- @xenia/signage: the venue clock's Intl call names its time zone where the
i18n guard reads it.
- tests: manager signage.test.mjs +1; e2e signage.mjs builds a menu board in
the editor (categories, a single product, the order, a badge, hiding, a
clock) and checks what was saved and resolved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Management → Signage: playlists (name, landscape / portrait, default
transition, duplicate, delete with the screens it plays on); the timeline
(drag or arrows to reorder, duplicate, remove, on / off, time and when it
shows at a glance, a round's total time); a slide's settings (name, seconds or
a video to its end, transition, days / hours / dates, the picture or video,
fit, text, alignment, font, colour, size, background colour or photo with
darkening; a menu board's title, columns and colours) with a live preview drawn
by @xenia/signage at 1920 × 1080 and scaled down; new slides empty or from
templates (promotion, announcement, happy hour 17-19, welcome, menu board,
video); a warning on the slide and its card when a picture or video doesn't
fit the playlist's shape. Unit tests (4), e2e signage.mjs builds a playlist in
the manager and the TV plays it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The signage slides (SlideView, TextSlide, MenuSlide, Widgets) and the pure
logic (schedule pick, slide windows, menu pages) move from the terminal into
packages/signage, so the manager's previews draw a slide exactly as the TV
does. Sizes are container units (cqmin) instead of viewport units: a slide
draws inside any box with container-type: size (frameStyle sets it on the
TV). Tests move with it (10). Dockerfiles copy its package.json; both apps'
Tailwind content include it; run-all runs its tests. Signage e2e and the
compose stack passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Menu board: the board's own order, grouped with headings or one list,
photos, descriptions, badges (translated), sold out crossed out with a
label, prices in the venue's money format, dotted leaders, a page dot row.
Pages: rows that fit from the frame's shape (portrait fits more), text size,
photos / descriptions, the title and widget bars (`page_size` overrides);
they go round every `page_seconds` while the slide lasts.
- Widgets on text and menu slides: logo, name, date, clock, message of the
day, QR code, weather (hidden without a forecast) in corners and bars, three
sizes.
- logic.js: menuPages, rowsPerColumn, frameHeightVmin, boardPages, menuMs,
pageAt, weatherIcon (+4 tests).
- e2e signage.mjs: a long board pages by itself, widgets in place, weather
hidden with no place, the chosen product first with its badge, a price change
and sold out show within seconds, a portrait TV needs fewer pages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- terminal/src/apps/signage: plays the screen's playlist (or the one its
schedule picks now, switching by itself) full screen: slides in order with
their time, a video to its end (a 15 min safety limit), only in their days /
hours / dates; transitions fade / slide / zoom / none (CSS, reduced motion
respected); the frame turned 90/180/270 for a TV mounted sideways. Picture,
video and text slides drawn; a first menu board (5.5b lays it out fully).
- Offline: the last GET /api/signage/screen kept in localStorage, every
picture and video (up to 120 MB) as an in-memory copy; reads again on
signage.changed / device.updated / reconnect / every 5 min.
- logic.js: the server's schedule pick ported (same test cases), slide windows,
next slide, frame; tests/signage.test.mjs (6).
- Signage screens get no offline banner over the slides, a small mark instead
(registry QUIET_OFFLINE).
- e2e signage.mjs (in run-all): a paired TV plays picture → text → video →
menu in order, the text's slide transition, rotation, keeps playing with the
server stopped (mark, no banner), catches up when it is back. terminal.mjs
passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- terminal.mjs: the looks API drives the idle screen; a second look on the
other display: two displays show two different slideshows from the library.
- manager.mjs: the default look's QR design through Settings.
- media.mjs: a new look with three pictures picked at once, a picture in a look
can't be deleted.
- pack README: the customer display row; CS-19 (screen designs are records a
device picks with a ref field).
- run-all --no-android: all passed except terminal's "server unreachable →
banner" (8 s wait, under load); terminal.mjs alone right after: all passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- media.mjs: batch upload through the Media page (the owner's ITEM PHOTOS
folders when present: 49 files incl. AVIF, all in), details and rename, a
product's photo from the library and one uploaded on the spot named after
the product, a used photo can't be deleted, the waiter fetches the photos
ahead and shows them offline. In run-all.
- startBackend gives each test backend its own XENIA_MEDIA_DIR.
- pack README: the media row (usage registration, `image`, MediaField, offline).
- run-all --no-android: every suite passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Table `media` (Alembic 0026): kind, name, original name, type, sha256
(unique), bytes, width/height, video length, who and when.
- Files under /app/data/media/<sha[:2]>/<sha>/: the original, and for
pictures thumb (200 px) / card (600) / full (1920) WebP, upright from
EXIF, never enlarged, transparency kept. Videos (MP4, WebM) kept as
uploaded; an MP4's length and size come from its header.
- GET/POST /api/media, GET/PATCH/DELETE /api/media/{id} for whoever manages
the menu, customer display, signage or menu tablets. The same file again
returns the existing item. The type comes from the bytes; 20 MB pictures,
200 MB videos, 60 MP; refused uploads leave nothing behind.
- GET /api/media/file/<sha>/<variant>: public (LAN), Cache-Control
public, max-age=1 year, immutable; byte ranges for video; a missing size
is made again from the original.
- register_usage(kind, fn): what uses media (products, displays, signage
from 5.2-5.4) declares it; delete is refused with media.in_use listing
the users.
- tests: test_media.py (12); stack.mjs uploads 3 MB through both nginx hops
and fetches a size with its cache headers (compose stack: all passed).
Backend suite: 490 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pack README: CS-3 now says orders are queued by id and priced on sync, refused lines
are shown, and no request a screen waits for may hang; rows for the waiter's texts /
colours guards and the table, ordering and bookings pages.
- run-all: the waiter suite's label lists what it covers.
- waiter.mjs: the language check waits for the profile save (the screen changes first).
- android.mjs: the "server really down" check accepts the offline screen in place of the
app (the start-up data failing shows it there since the bootstrap time limit), not only
on /offline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Waiter: Bookings (side drawer, for whoever has connect_orders.manage or
reservations.manage, with the online-orders app on): requests made online are
confirmed or declined with a reason the guest sees; confirmed ones are seated at a free
table (its seats shown, a warning mark when the party is bigger) or cancelled / marked
as a no-show; the food ordered ahead and its kitchen time; live updates.
- Backend: the bookings routes take reservations.manage too (require_any).
- @xenia/ui ReasonPicker + reasonText (gallery, unit test), first piece moved from the
terminal (4.6 → 4.8): the counter's online reject and booking decline dialogs use it;
the waiter loads @xenia/ui styles.css (the .x-* components; tokens as before).
- Tests: waiter e2e +2 (request listed with the key, confirmed and seated from the phone);
terminal.mjs and qr_table.mjs green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- order_items.source (Alembic 0025): waiter | counter | qr | online, set by the server
(orders.add_priced_items: the phone / manager 'waiter', the counter 'counter'; the QR
menu's lines 'qr', online orders 'online'; a split line keeps its source); lines of
existing online orders backfilled 'online'; in the order's item output.
- Waiter: lines the guests sent from the QR menu (or an online order) carry a "📱 QR" /
"🌐 Online" mark; the qr_order message's banner has "Open the table", and in the bell's
list the message opens it.
- Tests: source per channel, migration 0025, QR placement marks 'qr'; waiter e2e +1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner's choices for 4.8 (2026-11-18), all configurable:
- Setting orders.close_with_unpaid (default off): when off, the server refuses to close
an order with unpaid items (pos.order_unpaid) and the phone's CLOSE takes the payment
first ("instant-pay close"); when on, CLOSE confirms and the items stay unpaid. Manager
Settings → Operation, next to "auto-close after full payment" (unchanged).
- POST /api/orders/{id}/items/combine: unpaid lines of the same item (choices, note,
price, course, kitchen state; no discount / deal / tab) become one line; the phone
offers "Combine into one line" for selected lines or a grouped line. The grouping
views (identical / same item) stay as they were.
- Seats: the table's seats next to its name on the cards (waiter Settings → Layout, on by
default) and in the guests dialog, where more guests than seats only shows a hint.
- The table screen's last English-only labels (ADD, PAY, CLOSE, ACTIONS, SERVED, CLEAR,
ALL) are keys too.
- Tests: test_close_and_combine.py (5), waiter e2e +5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The waiter's --bg/--text/--accent… are made of @xenia/ui tokens: light / dark (user
menu) and the venue's accent reach every screen; the 751 colour literals in
waiter_pwa/src became tokens (by hue family and lightness), hex-alpha suffixes became
fade() (color-mix), fixing 'var(--accent)18' tints that never showed.
- @xenia/ui: new `special` (violet: offers, discounts, deals; contrast-tested) and
`on-colour` tokens.
- Setting venue.theme (teal | amber | blue | violet | rose, default amber), bootstrap
venue.theme, manager Settings → Venue → Colour; the waiter sets data-venue-theme and
the theme before the first render.
- Guard tests/no-colours.test.mjs; tests/e2e/waiter_look.mjs (every page light + dark,
side-by-side compare page); waiter e2e +3; backend test_venue_theme.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GET /api/tables/{id}/history: the table's closed / cancelled orders, newest first,
for the waiters of its zone (ordering.orders.open), never older than the history
module's history_days (free tier 31, D-6), module.disabled when history is off;
each order with times, total (cancelled items left out), people and items.
- Waiter: a History tab on the table (and "This table's earlier orders" on a free
table); orders expand to their items; the last answer is kept on the phone and
shown offline, marked as saved; the plan's day limit is shown.
- Tests: test_table_history.py (4), waiter e2e +2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Shift overview, order log, chat list / thread, offline + server search +
rediscovery screens, notifications, the refused-lines sheet and the offline queue's
reasons become keys; times and dates through useFormat() in the venue's clock.
- User menu: the other language(s) (data-testid menu-language-<lng>), saved to the
person's profile (PATCH /api/auth/me) and the bootstrap reloaded (D-12).
- tests/no-greek.test.mjs: no Greek letter in waiter_pwa/src (the one Greek word the
app recognises in staff messages is a \u escape).
- e2e: the test venue is English: waiter / browser / android use the English texts;
waiter.mjs +3 (English by default, switch to Greek at once and saved, after reload);
android bundle checks print what they saw when they fail.
- Pack README: the waiter texts rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The waiter app (and the manager's ordering tab) send what was chosen, by id; the
server prices it with the counter's code. No app sends a price any more.
- POST /api/orders/{id}/items takes `lines` (pos_cart's line + course_id,
price_adjustment, is_service_item): sales point checked first, refusals name the
product and line (order.line.*, order.not_sold_here); prices or selected_options in a
line -> order.line.client_price, the old `items` shape -> order.lines_required; a
by-hand price change needs ordering.prices.modify or a manager's approval (audited
PRICE_SET_BY_HAND). add_priced_items is the one writer of priced items (pos too).
- POST /api/orders/quote: the cart's total before sending; /api/pos/quote shares
pos_cart.quote().
- pos_cart: a preference set left out takes its default; a set at its free default
isn't stored; a default that costs is charged (the waiter never sent it: fixed);
an extra's sub-choice is charged per extra (the counter charged it once: fixed).
- @xenia/api lines.js: lineFromOptions / wireLine / estimate / LineError.
- Waiter: lines on send; cart total from the quote ("≈ estimate" offline); summary
shows the same prices; offline orders queued by id, priced on sync, refused lines
shown on a "Δεν στάλθηκαν" sheet (no empty order opened); dead ItemOptionsModal gone.
- Tests: test_order_lines.py (14), lines.test.mjs, waiter e2e +6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- lib/cdp.mjs: attach to the visible, non-empty page target (a replaced WebView can
leave the old target listed first); a closed DevTools socket fails pending calls at
once instead of hanging; every call has a timeout.
- lib/android.mjs: attach() follows the app's current process (socket named after its
pid; an old one can linger) and re-attaches before a call when the process or the
live page changed; a call cut off by the page going away is retried once.
ensureDevice() reboots an emulator up longer than EMULATOR_MAX_UPTIME_MIN (30).
- android.mjs: switching venues waits until /venues lists them (the app may still be
reloading into the last venue's bundle); a rediscovery timeout logs the page's DOM
and console next to the screenshot.
Run alone: rediscovery 7/7, basics 3/3, stacks 21/21.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Payments: ordering.orders.close checked on pay/close and the counter POS
(waiters have it by default, owner decision); pay-offline always recorded.
- The venue switches waiter_cancellations / price_adjust / revert are gone:
ordering.orders.cancel, ordering.prices.modify and the new
ordering.payments.revert (overridable) decide; moves/split/transfer/merge
need ordering.orders.open; discounts pricing.discounts.apply; chat chat.use.
- Venue role defaults: role_permissions (Alembic 0024), role_template(role, db),
GET/PUT /api/waiters/roles/{role}/permissions applying the change to everyone
with the role; manager Settings -> Operation -> "What each role may do".
0024 also grants the new key to existing owners and store managers.
- Bootstrap `approvable`; @xenia/access useAllowed(key) -> yes/approve/no.
The waiter shows each action by key, "with a manager's approval (PIN)" where
allowed; GET /api/orders/cancel-permissions removed.
- Tests: test_waiter_keys.py (11), access allowed(), waiter.mjs +5, manager.mjs +3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Login follows auth.waiter_login_mode / auth.waiter_require_username from the
bootstrap: name + PIN, name + password, typed username, or a "paired screens
only" message for tap mode. POST /api/auth/login {client: "waiter"}; a miss
shows the translated error without a reload.
- POST /api/auth/login-by-id removed; bootstrap login carries waiter_mode and
waiter_require_username.
- Sign-out ends the session on the server (POST /api/auth/logout), so
single_session_waiter = refuse_new no longer strands a waiter.
- Lock on the phone: menu "Lock", automatic lock / sign-out after inactivity
(security.auto_lock*, auto_logout*), unlock with the PIN in the same session,
lock kept across app restarts (restore() no longer clears it).
- e2e: new waiter.mjs (22 checks) in run-all; android.mjs signs in for real and
locks/unlocks on the emulator; TLS live check waits for the socket; the
rediscovery helper re-attaches to a stale WebView handle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan step 4.1. No visible change to layout or flows.
- api/client.js on @xenia/api createApiClient (CS-8 baseURL, 401 → sign out, no answer →
backend-offline, err.xenia, the manager-approval retry); the PIN login handles its own 401
(before, a wrong PIN reloaded the page).
- <AccessProvider> at the root with an i18n instance: modules, permission keys, venue,
language from bootstrap; who is signed in comes with it (no more /api/auth/me polling).
packages/access: AccessProvider gains `cache` (the last bootstrap per session; used when
the server can't be reached, `offline` in the context, keeps retrying) and `failed` (the
app's own screen when there's nothing cached). The waiter caches per venue, shows its
offline page (server search) on a first start without a server, retries every 5 s;
ServerRediscovery and BundleSync run outside the bootstrap.
- Role names → keys: the shift gate and the user menu use core.dashboard.access.
- One shared, offline-cached read of the venue settings (api/venueSettings.js) instead of
seven GET /api/settings/ calls; apiError() shows backend error codes in the user's
language (17 places).
- Lint: 78 errors → 0 (unused code, empty catches, two duplicate style keys, a component
created during render, refs read during render → state, hooks after an early return);
set-state-in-effect is a warning like the manager/terminal; lint in run-all.
- Tests: tests/bootstrapCache.test.mjs; e2e browser: an offline restart stays signed in.
Android rediscovery waits for what the screen shows instead of fixed sleeps: 10/10 three
runs in a row (KI-009). Terminal 3.4 waits for both displays before the sale.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan step 4.0. Owner (2026-11-17): no phone in use needs to keep working, so no
compatibility path.
- Removed the SSE channel: routers/sse.py (/api/sse/stream, which still accepted a JWT whose
session had ended — a signed-out phone could keep listening), services/sse_bus.py (every
backend module now calls services/ws_bus.broadcast_sync directly), waiter useSSE.js.
- Credentials only in the first frame: the waiter's useWebSocket and the manager's
LiveProvider send {token} there like the terminal; routers/ws.py no longer reads ?token=
(a token in a URL ends up in proxy and server logs).
- Waiter: SSEContext → LiveContext (LiveProvider, useLiveContext, liveAlive, the
'live-event' / 'live-reconnected' window events), dead SSE compat code removed.
- Tests: a token in the address is refused, /api/sse/stream is 404; e2e browser (3 delivery
modes) and manager assert no token in the live connection's address. Android taps now
wait for their element (the fixed sleeps made the suite flaky, KI-009).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan step 3.5.
- The public /api/phone/ws socket is removed (anyone on the LAN could listen to every
caller). GET /api/phone/call-event stays public for the Grandstream UCM but is LAN-only in
the proxy (the 443 blocks' LAN-only location now covers it, in nginx-proxy/nginx.conf and
install.sh), with an optional shared secret (setting caller_id.secret → &key=).
- Calls are logged (phone_calls, migration 0023), matched to a customer on the server
(services/caller_id.py: Greek number rules moved from the manager) and published as
`call_incoming` {call_id, at, number, ext, customer card: visits, spent, last 3 orders} to
users with caller_id.use and to the counter POS screens. GET /api/phone/calls (the log),
GET /api/customers/lookup?phone=. Calls older than a minute don't pop up (replays).
- Manager: PhoneListener on the live connection and the shared Dialog (no more downloading
every customer to match); Integrations → Caller ID shows the server's log live and the UCM
Action URL. Counter: CallPopup with "New takeaway sale".
- Tests: tests/test_caller_id.py (10), terminal unit test, e2e terminal and manager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Plan phase 3S, step S.99.
- GET /api/connect/fees returns `links` {order, menu}: the ordering app and QR menu
addresses, from the cloud's apps_url (heartbeat) and the site id.
- Manager: "Your ordering link" card (OrderingLink.jsx) on Online ordering: the address, its
QR code, copy / open / print, to share or put on the website and window.
- Pack README: routers/fees.py row.
- Tests: the link (backend), the card (manager e2e).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan phase 3S, step S.7.
- tables.qr_token (migration 0021): a random token per active table; services/table_qr.py
(tokens, rotate, the snapshot's `qr` with the tokens' sha256 only, the code's link from the
cloud's apps_url); setting connect_menu.table_ordering (read-only by default).
- /api/connect/qr (connect_menu.manage): the codes, ordering on/off, a new code per table or
for all; table and QR changes push the menu at once (MENU_PATHS).
- Pull: a QR order with a table id goes onto the table's open order or a new one
(services/qr_orders.py): items at the cloud's prices, kitchen tickets, KDS, order_updated
(the waiters' phones and the counter), a `qr_order` message to the order's waiters or the
table's zone waiters; audit QR_ORDER (a repeated pull adds nothing); the cloud is told
"accepted" (the guest's page: in the kitchen). No usable table or no open day → the counter
gets it as before. Waiter app: the message's look.
- Manager: Online → Table QR codes (/online/qr): ordering switch, the menu link, a QR card
per table (print all), new code per table / for all.
- Heartbeat: apps_url kept in the license state.
- Tests: tests/test_qr_table.py (5); e2e qr_table.mjs (a real cloud and venue: table 5's
code → two dishes on table 5's order, KDS, live event, the guest's page; a forged code
refused; a new code kills the old one), in run-all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan phase 3S, step S.6.
- Pull: "reservation" / "preorder" orders become Reservations waiting for an answer
(status "requested"; services/online_reservations.py), with the food ordered ahead kept on
the booking (items_json at the cloud's prices, the site's price check) — no order yet.
Migration 0020 (reservations: online_order_cloud_id, online_ref, items_json, total,
online_price_diff, fire_at, order_id, response_note).
- Confirm → the food's fire time = booking time − fire minutes (setting); the fire worker
(connect_orders, every 20 s) turns the food into an order at that time (needs an open
business day; waits otherwise): kitchen tickets, KDS (reference and time). Early arrival
fires at once. Seating moves the order to the table (refused if the table has an open
order). Decline / cancel / no-show with a reason. Every step mirrored to the cloud.
- Found: the KDS filter dropped every online order without an online status (SQL NULL in
NOT(a AND b)) — made NULL-safe.
- Counter: Online → Bookings (requests first, then upcoming), BookingPanel (confirm,
decline with reasons, food and when it goes to the kitchen, seat at a free table, cancel,
no-show); the Online badge and chime count booking requests.
- Manager: Online ordering → Table bookings settings (on, food ahead, hours, slot, notice,
days ahead, party size, fire minutes); the dashboard's reservations card confirms /
declines online requests; the reservations router delegates online bookings' status steps.
- Tests: tests/test_online_bookings.py (8), unit tests (terminal, manager), e2e: order app
(book with food → the venue confirms), terminal (request → confirm → the two dishes reach
the KDS at the fire time, not before → seated), manager (booking settings).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan phase 3S, step S.5.
- Pull: an online order keeps the customer's time (orders.requested_for, None = as soon as
possible) and delivery area; quick options are stored in the site's entry shape; items get
their cost snapshot.
- The delivery fee is its own order line: a system product (products.system_key
"delivery_fee", lifecycle "system", sold nowhere; services/system_products.py), created on
first use in the venue's language with the VAT group most products use. Added printed and
served, so kitchen tickets and the KDS never see it; paid at the counter with the items,
counted in the shift, on the fiscal receipt with its VAT group. Never listed in the
catalogue (products list, export, edit endpoints → 404) and never added by hand.
- Price check (services/online_check.py): each line priced as the snapshot prices it, at the
order's time, and the fee through the same engine with the site's rules and the cloud's
area id; differences kept on orders.online_price_diff and shown. The customer pays what
the cloud charged.
- Counter: time chip (or as soon as possible), area, fee line, price warning; takeaway is
its own kind (was shown as "at the venue") and finishes as "collected". KDS cards show the
online reference and the time; kitchen tickets print the reference, the type and the time.
- Manager: Online ordering → "The fee on the receipt" (name, VAT group;
PUT /api/connect/fees/fee-product, fees.vat_group_unknown); the online orders page shows
the time, area and price warning.
- Migration 0019. Tests: tests/test_online_site_side.py (6), terminal unit test, e2e
(terminal: fee, time, warning, paid in full; manager: fee line settings).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- connect_orders.ordering setting; GET/PUT /api/connect/fees/ordering (validated:
services, hours per day incl. past midnight, preparation, slot minutes, days ahead,
ASAP); pushed to the cloud with the menu (snapshot `ordering`).
- Manager: the Online ordering page gains "Services and hours" (OrderingSettings.jsx; logic
in feesLogic.js, unit-tested); nav label "Online ordering".
- tests/e2e/order_app.mjs: a real cloud + the built order app in a phone-sized browser:
takeaway and delivery placed, priced by the cloud (fee by area, minimum refused), the
site moves the delivery to delivered and the page follows; a rejection with its reason;
Greek. In run-all, with the order app's unit tests.
- Tests: backend +1 (406), manager unit +1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- models/fees.py + Alembic 0018: delivery_areas, fee_rules; key connect_orders.fees
(owner, store manager; existing ones get it).
- services/fees.py: the pure engine (set / add / % / free / minimum, conditions: sales
points, areas, products total, item count, days, time incl. past midnight, stop), the
same file as the cloud's; tests/fixtures/fee_cases.json shared, plus a test that the
cloud copy is identical.
- routers/fees.py at /api/connect/fees: areas and rules CRUD (validated), order, preview.
- Snapshot carries fees + the venue's time zone; a change to products, pricing or fees
pushes the menu within ~5 s (middleware -> cloud_sync.request_menu_push).
- Manager: Online -> Delivery fees page (@xenia/ui): rules in order with words for each,
areas with postcodes, "Test an order"; en/el texts; feesLogic.js unit-tested.
- Tests: test_fees.py (39), manager unit +5, manager.mjs +7 on the real page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- services/cloud_sync.menu_snapshot(db) (split out of the push, tested): sold_at + prices
per customer-app sales point from the pricing engine; digital_price = the QR menu's.
- store_online_orders: sales_point from the cloud (older clouds: from the type), takeaway
orders typed takeaway, the QR menu's table in front of the customer's note.
- manager e2e: waits for the live connection (html[data-live]) instead of a fixed 1.5 s,
and for the server to record "read" (two timing races seen in a full run).
- Tests: +2 in test_sales_points.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- services/fiscal/: one driver interface (prepare_receipt / prepare_credit_note -> send,
credit_notes flag, status); the dTEC100extra folder bridge moved into txt_file.py as the
first driver, same command files. fiscal_service.py removed, callers moved.
- Refunds: models/refund.py + Alembic 0016 (refunds, refund_items; ordering.refunds for
existing owners/managers). services/refunds.py: today's business day, the cashier's open
shift, partial quantities, items from another shift need ordering.refunds or a manager's
approval (check()/authorize() return the override row). Paid items are never edited.
- POS: GET /api/pos/receipts, GET /api/pos/receipts/{id}, POST /api/pos/orders/{id}/refund
(cash opens the drawer; fiscal "manual" when the driver can't issue credit notes).
- Shift totals subtract refunds and now count discounts; day close and business-day
reports carry refunds.
- Terminal: Receipts mode (ReceiptsView, ReceiptPanel, logic/refunds.js), en/el texts.
- Tests: test_pos_refunds.py (12), terminal unit +1, terminal.mjs +7.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Counter POS gets an "Online" mode (module on + connect_orders.manage): New / In
progress / Finished, a chime on arrival (and every 30 s while one waits), badge,
toast in any mode; the order panel offers only the next step: accept / reject with
a reason, preparing, ready or out for delivery, then take the payment (shared
PaymentDialog, drawer, shift) and mark delivered/served.
- connect_orders router on v2 conventions: require(connect_orders.manage), error
codes online.not_found / online.status_changed, the cloud's step order enforced,
audit rows, GET /api/connect/orders/board. POS device scope gains connect_orders.*;
barista and barman get the key by default.
- Fixes: the KDS showed online orders before acceptance; accepting printed no
kitchen tickets; a pull whose synced mark failed stored the order twice
(store_online_orders skips known cloud ids); pulled orders lacked the business day
and delivery type; rejected orders kept active items; delivered sets closed_at/by.
- Online orders belong to holders of connect_orders.manage (_can_access_order), so
the counter pays them with POST /api/pos/orders/{id}/pay.
- Tests: test_pos_online.py (5), terminal unit +1, terminal.mjs +17 with a fake
cloud (pull, synced, status mirror); fixed a timing race in a 3.3c check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POS: GET /api/pos/tables (the cashier's zones as in the waiter app, each open order's
totals, people, ready items, flags, reservation), POST /api/pos/tables/{id}/items (into
the table's order or a new one via orders.open_order + add_items), POST
/api/pos/orders/{id}/pay (chosen items, cash/card/split, drawer on cash), POST
/api/pos/orders/{id}/close (only when nothing is unpaid). Quote takes order_id so the
order's items count for cart conditions (shared pos_cart.order_cart, used by add_items).
- New codes pos.table_not_found, pos.table_not_yours, pos.items_changed, pos.order_unpaid.
- Fix: item cancels (DELETE item, cancel-items) now broadcast order_updated, so phones and
kitchen screens see them at once.
- Terminal: Sale | Tables switch, zone list, table cards by zone, TablePanel (order lines,
new lines, send, pay selected/all, cancel with approval, close), generic PaymentDialog.
- Tests: test_pos_tables.py (8), terminal unit, terminal.mjs +17 with a live phone socket.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST /api/pos/sales: all checks first (shift, lines, payment split, cash given,
discount → ordering.prices.modify or manager approval, fiscal VAT groups), then the
existing open_order / add_items / pay_items functions, so tickets, KDS, price events,
shift totals and the fiscal receipt work as for any order.
- Cash drawer: printer_service.open_cash_drawer (ESC @ + ESC p 0 25 250) to the screen's
receipt printer on cash, logged and audited (DRAWER_OPENED / DRAWER_FAILED).
- orders._can_access_order: the people assigned to an order may act on it (a cashier's
own takeaway order); pos_cart prices a batch with the lines before it, as add_items does.
- Terminal: Charge → payment dialog (exact cash pre-selected, quick amounts, change,
card, split by line), per-line discounts, sale summary and "Same again".
- Tests: backend +6 (socket printer receives the drawer kick, fiscal file in the bridge
folder), terminal unit +1, terminal.mjs +9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Backend /api/pos (pos_counter): session (business day, the cashier's own shift,
self-start, who can open the day), menu (sellable products with every kind of choice,
no costs; price now from the pricing engine), quote (lines by id → the waiter's
selected_options entries with DB prices → resolve_price as orders do; pos.line_invalid).
- POS device settings: default order type, start category, receipt printer (new ref
sources categories / printers, also in the manager's Devices dialogs).
- Terminal apps/pos: shift gate (start shift with drawer cash), categories, search,
product grid, price check, options dialog, cart priced by the backend.
- Tests: backend test_pos (13), terminal pos.test.mjs, manager refOptions,
terminal.mjs +10 POS checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Deleted pages/KdsPage.jsx, its /kds route, nav entry and text: the kitchen display
runs only on paired screens (D-25).
- Apps: cards of apps that run on a screen get "Set up a screen" (core.devices.manage)
→ /devices?pair=<app>, which opens the pair dialog on that app.
- manager.mjs: no "Open" on the KDS card, "Set up a screen" lands on the pair dialog,
/kds is gone; the module-off rule stays covered by the Notes checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- order_items.claimed_by / claimed_at (Alembic 0015). POST/DELETE
/api/kds/orders/{id}/items/{item}/claim (kds.bump): someone else's claim is refused
(kds.item_claimed), letting go works for anyone with kds.bump; live kds_item_claimed.
In progress claims for whoever did it; done/served/pending/declined clear the claim.
- Fix: order-level status and decline from a zone screen changed every zone's items;
now only the screen's zone, and a zone screen sees the order status of its own items.
- Terminal: "I'm on it" / "Let go" on the selected card, the cook's name on claimed items.
- Tests: backend +6, terminal unit +1, terminal.mjs +6 with a second screen and cook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- @xenia/ui: --x-board-* tokens (the kitchen display's look: dark board, light cards,
status colours, card radius/shadows, number font), Tailwind board.* colours, contrast
test for the board pairs; near-identical shades merged.
- New shared Stepper component (gallery + ui.mjs), labels ui.decrease / ui.increase.
- KDS: theme.js maps to the board tokens, no colour literals left (only stored setting
values); decline / call waiter / settings use Dialog, Button, Switch, Select, Stepper;
toasts are @xenia/ui toasts (ToastProvider at the terminal root).
- Terminal: apps can set their theme (APP_THEMES, KDS dark) while they run.
- CS-16: board screens and "no hard-coded colours in app code".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of the manager's KdsPage.jsx into terminal/src/apps/kds, split into pure logic
(layout packing, age, buckets, rounds, totals, status cycle, settings; unit-tested) and
components (card, item, action bars, dialogs, item totals, rails, settings panel).
- Settings are the device's config; the settings panel saves them (managers only),
zoom changes the size for the session.
- Orders reload on live events and every reconnect; polling only while the live
connection is down (DeviceProvider exposes liveUp; useLiveEvents helper).
- "Tap to start" unlocks sound; venue clock via useFormat; English-first texts.
- Undo of an item recomputes the order status at once; undo/redo clear the selection.
- Tests: terminal unit +15, terminal.mjs +12 KDS checks (no polling, live order + chime,
item/undo/prepare/decline, settings permission, change made elsewhere), backend
regression for an item back to pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
- Pairing screen: requests a code, shows it big, polls with the secret, new code on
expiry, keeps the device token; "removed from the venue" notice after a revoke.
- Sign-in per device mode: PIN (name + PinPad), tap your name, password (name +
password), none (straight into the app). Names = holders of <app>.access, refreshed
every 30 s and on reconnect. Slim bar with screen, user and Sign out; idle sign-out
after the device's auto_sign_out_minutes; hourly token refresh (same session).
- DeviceProvider: GET /api/devices/me (retried while unreachable), session, the live
connection with credentials in the first frame (device.updated -> reload, app moved ->
sign out, device.revoked -> forget, session.ended -> sign out), offline banner;
useLiveEvent for apps. Screen choice is pure (device/flow.js, unit-tested).
- Blocked screen: app turned off / not licensed / device refused, recovers by itself.
- @xenia/access AccessProvider: autoRetryMs (retry bootstrap while unreachable).
- Tests: terminal unit tests (screen choice, live actions, idle, pairing polls), new
tests/e2e/terminal.mjs (18 checks), manager.mjs owner flow now pairs and signs in on
the real terminal screen; run-all runs terminal.mjs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- terminal/: new workspace app (Vite + React 19 + Router 7, Tailwind on the shared
preset, @xenia/i18n namespace `terminal`, @xenia/api client sending X-Xenia-Device,
@xenia/access bootstrap). Apps are lazy chunks by app_key (kds, pos_counter,
customer_display placeholders); start screen; "unknown app" screen; dev-only
/ui-gallery and /i18n-sample. Device + session tokens in a storage wrapper.
- Image pos-terminal (terminal/Dockerfile, context client-services/); every frontend
Dockerfile copies terminal/package.json for npm ci.
- docker-compose(.dev).yml: service terminal; proxy publishes 8082.
- Proxy (nginx-proxy/nginx.conf == install.sh heredoc, CS-5): server :8082, LAN-only
allow/deny, WebSocket upgrade; the terminal upstream is resolved per request so the
proxy still starts on a stack without the terminal container.
- install.sh prints the screens address.
- Tests: terminal unit tests + lint in run-all; new tests/e2e/stack.mjs (release images
on one compose stack: :8082 serves the app, /api + WebSocket through both hops,
403 from a non-LAN docker network on 8082 and 8081, proxy up without terminal).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- WebSocket: credentials may come in the first frame ({cursor, token?, device?}).
A device token alone connects a paired screen (login-none apps get every event, a
sign-in app only events addressed to it); a terminal session's JWT needs its own
device, as over HTTP. Refusals send {type: refused, data: {code}} + close 4001/4003.
- ws_bus: registry of open sockets by user, session and device. Ending a session
closes its sockets (session.ended); revoke/reassign close the device's sockets
(device.revoked / device.updated); edits and module on/off send device.updated.
Events can target devices (device_ids=..., sync_events.target_device_ids, rev 0014).
Pushes go through each socket's own loop (call_soon_threadsafe).
- Device config: DeviceApp.config = typed ConfigFields, validated on pair/edit/
reassign (validation.device_config), effective values (defaults filled) in both
device views and the module catalogue. First field: auto_sign_out_minutes (KDS, POS).
- Manager: DeviceConfigFields renders an app's fields in the pair and edit dialogs.
- @xenia/api createLiveClient: `credentials` and `onRefused` options.
- Tests: tests/test_live.py (11), module texts for config fields, live client,
devices logic, manager.mjs device setting + live socket checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cleanup before platform-v2 phase 3 (owner-approved).
- KI-008: GET /api/reports/orders/export read order_history's dicts as ORM rows and
always failed with 500; it also ignored business_day_id (the Today page sends it).
Rebuilt on the dicts, header even when empty. tests/test_reports_export.py.
- KI-010: OnlineOrdersPage listened on /api/stream (never existed: no live refresh,
a 404 every few seconds). It now refetches on the shared live connection
(online_order_received / online_order_updated / ready); 20 s polling stays as a
fallback. manager.mjs checks nothing asks for /api/stream.
- KI-007: the setup wizard seeds the 10 default table flags and 5 quick messages in
the venue language (services/defaults.py), only when none exist. v1's seed never
worked (NOT NULL columns missing). Managers edit them in Settings -> Operation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform-v2 step 2.99d, owner decision 2026-11-14.
- New core setting auth.idle_days (int, default 14, 0 = never). A manager, waiter or
paired-device session unused for that long ends with reason "idle" on its next
request (sessions.validate) or when someone opens "Signed in now"
(sessions.end_idle in GET /api/auth/sessions). Support keeps its own 4 h expiry.
- Manager: Settings -> Sign-in & security -> "Sign people out after" (7/14/30/60/90
days / Never; a value set elsewhere is kept); "Signed in now" names the reason.
Texts en/el.
- Tests: backend 284 (+ 14-day default, list drops idle ones, setting incl. 0);
manager e2e checks the default and saving 30. The support-access check that
failed once in ~8 runs now saves a screenshot and the page's alert text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform-v2 step 2.99b.
- npm update of the advised packages, within their ranges: what ships to browsers
is axios 1.15.1 -> 1.21.1 and react-router(-dom) 7.14.1 -> 7.18.5 (both apps);
build tools: vite 8.0.9 -> 8.3.8 (rolldown 1.2), postcss 8.5.33, babel 7.29.x,
browserslist, js-yaml, zod, brace-expansion, nanoid, source-map-js... 30 -> 11
advisories; the 11 left are build-time only (vite-plugin-pwa/workbox-build chain,
@capacitor/cli -> xcode -> uuid) and move to 2.99c.
- manager_dashboard/eslint.config.js = the waiter's rules; `npm run lint -w
manager-dashboard` checks the v2 code (file list in the script), in run-all.mjs.
set-state-in-effect is a warning until phase 6 moves page loading to react-query.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform-v2 step 2.99a. After 2.6 no frontend calls these any more:
- POST /api/auth/login needs `client` (manager/waiter/terminal); the no-`client`
path with v1 rules and the `legacy_manager` single-session exception are gone.
- GET /api/setup/security-config (bootstrap's `login` replaced it in 2.6b).
- POST /api/recovery/use (a recovery code works in the normal login's
password field).
- PUT /api/waiters/{id}/permission and /reset-permissions (the permission editor
saves keys with PUT /{id}/permissions); staff create/update ignore perm_* fields.
- The v1 perm_* projection: core/access/legacy.py deleted, UserOut carries only
`permissions` (no app reads the 13 booleans, waiter included).
e2e manager login sends client "manager"; smoke_routes too. Backend 281 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>