Commit Graph
127 Commits
Author SHA1 Message Date
bonaminandClaude Opus 5.5 198f8ff571 feat(waiter): close with unpaid items as a setting, combine lines, seats (platform-v2 step 4.8a)
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>
2026-11-17 09:54:37 +02:00
bonaminandClaude Opus 5.5 beb53c65bb feat(waiter): the look on the shared tokens; the venue's colour (platform-v2 step 4.6)
- 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>
2026-11-17 09:08:39 +02:00
bonaminandClaude Opus 5.5 8e0a786bbc feat(ordering): orders priced by the server (platform-v2 step 4.4)
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>
2026-11-17 03:35:03 +02:00
bonaminandClaude Opus 5.5 8abe4d92d3 feat(waiter): what a waiter may do comes from permission keys (platform-v2 step 4.3)
- 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>
2026-11-17 00:54:08 +02:00
bonaminandClaude Opus 5.5 f85894a72e refactor(connect): one live connection, no token in any address (SSE removed)
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>
2026-11-16 10:49:21 +02:00
bonaminandClaude Opus 5.5 dabe807ce0 feat(connect): caller ID as an integration: calls on the signed-in live connection, matched on the server
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>
2026-11-16 09:06:39 +02:00
bonaminandClaude Opus 5.5 88a9703902 feat(terminal): the customer display, with an idle screen each venue designs
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>
2026-11-16 08:34:05 +02:00
bonaminandClaude Opus 5.5 18d580d87c feat(manager): the venue's online ordering link and QR code on the Online ordering page
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>
2026-11-16 01:36:02 +02:00
bonaminandClaude Opus 5.5 652e6a26af feat(connect): the QR menu at the table: one code per table, orders straight onto the table
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>
2026-11-16 01:26:55 +02:00
bonaminandClaude Opus 5.5 70c8f2bb57 feat(connect): table bookings from the online ordering app; food fired to the kitchen before arrival
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>
2026-11-15 19:31:44 +02:00
bonaminandClaude Opus 5.5 0ca700279a feat(connect): the site side of online orders: fee line, customer's time, price check
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>
2026-11-15 15:38:25 +02:00
bonaminandClaude Opus 5.5 8ea44d71aa feat: online ordering settings (services, hours, preparation, slots) and the order app e2e (platform-v2 3S, S.4)
- 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>
2026-11-15 13:39:13 +02:00
bonaminandClaude Opus 5.5 9bfe54554d feat: delivery areas and fee rules with "test an order" (platform-v2 3S, S.3)
- 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>
2026-11-15 12:28:29 +02:00
bonaminandClaude Opus 5.5 ffeb2b45cb feat: the menu snapshot carries a price per sales point; pulled orders keep the cloud's sales point and table (platform-v2 3S, S.2)
- 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>
2026-11-15 11:38:46 +02:00
bonaminandClaude Opus 5.5 1b468fe44b feat: sales points, offerings and prices per sales point (platform-v2 phase 3S, step S.1)
- core/sales_points.py: in_store, in_store_takeaway, qr_table, online_takeaway,
  online_delivery, online_preorder (+ old channel names mapped).
- Alembic 0017: orders.sales_point (backfilled), products.sold_at (from digital_visible),
  digital_price/digital_discount -> item price modifiers for the QR menu and online,
  order_channel conditions -> sales points; drops the three digital columns.
- Every order records its sales point; the pricing engine's channel is it; items not sold
  there are refused (order.not_sold_here, pos.line_invalid not_sold_here).
- POS menu: only what the counter sells, prices per counter sales point; the screen shows
  the order type's products and prices. Waiter app asks for in-person products.
- Cloud snapshot: products sold by the customer apps, priced by the engine.
- Manager: product "Where it's sold" tab; pricing condition shows sales points.
- Products API, catalogue export/import carry sold_at.
- Tests: test_sales_points.py (8, incl. the migration), access +1, terminal +1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:00:40 +02:00
bonaminandClaude Opus 5.5 17bee66df1 feat(terminal): counter POS screen with server-priced cart and shift gate (platform-v2 3.3a)
- 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>
2026-11-14 21:55:30 +02:00
bonaminandClaude Opus 5.5 b1112b249e feat(manager): remove the KDS page; app cards lead to pairing a screen (platform-v2 3.2d)
- 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>
2026-11-14 20:46:50 +02:00
bonaminandClaude Opus 5.5 d5c4400fde 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>
2026-11-14 18:56:59 +02:00
bonaminandClaude Opus 5.5 7ff3c3b48e feat(terminal): terminal app shell, pos-terminal image, LAN-only proxy port 8082 (platform-v2 3.1b)
- 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>
2026-11-14 17:02:20 +02:00
bonaminandClaude Opus 5.5 bda5cde92b feat(backend): live connection and per-device settings for paired screens (platform-v2 3.1a)
- 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>
2026-11-14 16:31:59 +02:00
bonaminandClaude Opus 5.5 034426f870 fix: orders CSV export, Online Orders live refresh, starter flags and quick messages
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>
2026-11-14 14:08:54 +02:00
bonaminandClaude Opus 5.5 f1f20f7bba feat(backend): sign people out after N days without use (auth.idle_days, default 14)
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>
2026-11-14 13:38:00 +02:00
bonaminandClaude Opus 5.5 cc4e76019b chore: deliberate dependency upgrades; drop legacy-peer-deps; Capacitor 8.6.2 (shell build 2)
Platform-v2 step 2.99c.
- Both apps on the same current versions: React 19.3.1, react-query 5.107.1,
  router 7.18.5, axios 1.21.1, zustand 5.1, vite 8.3.8, plugin-react 6.3; manager
  lucide-react 1.14 -> 1.73, recharts 3.8 -> 3.10.
- i18next 27.1.1 + react-i18next 18.0.1 (exact pins). Shared options moved to
  packages/i18n/src/options.js with returnEmptyString: true (27 shows the key for an
  empty text otherwise); tests/instance.test.mjs guards it, plus fallback, code
  casing and plurals.
- vite-plugin-pwa 2.0 lists Vite 8 as a peer: .npmrc (legacy-peer-deps) removed,
  `npm install` resolves without it.
- Native (CS-10): @capacitor/core/android/cli 8.6.2, @capacitor/app 8.1.2,
  @capgo/capacitor-updater 8.54.2; versionCode 2 / versionName 1.1.0 and
  MIN_SHELL_BUILD 2. capacitor-updater 8.54 refuses plain-HTTP downloads by
  default, which broke every bundle check in the stacks suite: httpsOnly: false in
  capacitor.config.json (venues have no domains; zips are sha256-checked).
- npm audit: 6 left, all in workbox-build 7.4.1 (build time).
Full run-all incl. Android passes (Android re-run after the httpsOnly fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 13:22:51 +02:00
bonaminandClaude Opus 5.5 e9b6ef57e0 chore: patch npm advisories in shipped and build code; add a manager ESLint config
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>
2026-11-14 12:35:50 +02:00
bonaminandClaude Opus 5.5 2426ffddad feat(manager): notification bell, sign-in/venue/print settings, log download (platform-v2 2.6f)
- Bell in the header: /api/platform/notifications with unread count, live via
  the new LiveProvider (one createLiveClient connection) on platform_notification
  and reconnect; mark read / all; warning+critical pop a toast.
- Settings: Sign-in card (manager/waiter/device modes, require username, one
  session per manager/waiter, username autofill) replaces the dead v1
  security.login_method card; new "Venue & language" tab (language, time zone);
  print alert threshold in Printing. Tab labels are i18n keys.
- Technical > Log files: list + download of the daily logs (owner-level).
  Backend: GET /api/system/logs, /api/system/logs/{date} (core.settings.manage),
  error system.log_not_found.
- Setup wizard asks staff language and time zone (setup/init stores them).
- @xenia/ui theme helpers (applyTheme, getStoredTheme); the manager stays light
  until phase 6 converts the older pages (owner decision 2026-11-14).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:01:26 +02:00
bonaminandClaude Opus 5.5 92bc1b0113 feat(manager): staff permission editor, signed-in sessions, approvals log (platform-v2 2.6e)
- Staff: the 13 perm_* tick columns become one Permissions column (count,
  "changed from role") opening an editor grouped by module, from
  /api/waiters/permission-catalog: switches labelled per key, keys you don't
  hold are disabled with the reason, reset to role defaults (names what it
  can't give), save the whole set; access.cannot_grant explained by label.
- "Signed in now" (/management/sessions): who, where (app or device), since,
  last active, your own session marked; end session; show ended + reason.
- "Manager approvals" (/management/approvals): the override audit with
  action label, asked by, approved by, device, used/not used, order link.
- Backend: sessions list adds device_name/device_app/current/expires_at;
  overrides list adds device_name/expires_at.
- Permission labels for every key in modules.json (en/el), guarded by
  test_module_texts; manager unit tests for the editor logic; e2e 66 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:10:57 +02:00
bonaminandClaude Opus 5.5 cc00ec39c7 feat(manager): Devices page — pair by code, app, name, sign-in mode, link, change app, remove
Platform-v2 step 2.6d:
- /devices (core.devices.manage, sidebar): devices from /api/devices with
  status (online / last seen / waiting for the device / app turned off /
  removed), app, sign-in mode (own or venue default), linked device; usage per
  device app against the license limit (devices)
- pair dialog: code as typed (normalized), app (only apps that are on, "all in
  use" when the limit is reached), name, sign-in mode for apps with a choice,
  optional linked device; license.limit_reached explained with the app's limit
- edit (name, sign-in mode, link), change app (signs out whoever is on it),
  remove with confirm (the device goes back to pairing), show removed
- manager_dashboard gets node --test (tests/platform.test.mjs: module states,
  dependents, device status/usage/room/links), added to run-all
- e2e manager.mjs: 54 checks (+ wrong code, normalized code, pair, the device
  picks up its token, online, rename, change app, remove → device.revoked)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 23:22:43 +02:00
bonaminandClaude Opus 5.5 0d0b2d78e1 feat(manager): Apps, Integrations and License pages on the module catalogue
Platform-v2 step 2.6c:
- Apps (device apps, features, always-included core) and Integrations: module
  cards from GET /api/platform/modules with state (on / off / waiting for a
  dependency / not in your license / always on), dependencies, limits and an
  Open button where the manager has a page; core.modules.manage toggles them
  (PUT /api/platform/modules/{key}), with a confirm listing the modules that
  stop too; bootstrap reloads so the sidebar follows at once
- License page: licensed / free (with the reason) / development, site id,
  validity, last contact, "check the license now" (POST /api/system/sync-license),
  every module's entitlement and limits
- i18n: new `modules` namespace (names, descriptions, limit labels, en + el)
  kept complete against the registry by local_backend/tests/test_module_texts.py
- nav: Integrations and License in the sidebar; old AppsPage removed
- e2e manager.mjs: 43 checks (+ card states, toggle from the card, dependency
  warning, integrations, license page)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:33:54 +02:00
bonaminandClaude Opus 5.5 49a412d748 feat(manager): v2 sign-in (login modes, support access, license notice) and an unlock endpoint for the lock screen
Platform-v2 step 2.6b:
- backend: POST /api/auth/unlock {pin|password} checks the CURRENT session's
  user and keeps the session (no new login/token); 5 wrong tries end it
  (auth.wrong_pin with attempts_left, then auth.session_ended); bootstrap
  gains `login` (manager_mode, autofill_username, support)
- manager LoginPage rewritten on @xenia/ui + i18n: client "manager", password
  or PIN pad per setting, remembered/only account card, support access panel
  (challenge -> code -> 4 h session, not remembered as an account), notice
  when the license runs the free tier (expired/inactive/locked/clock/unverified)
- lock screen on /api/auth/unlock with the shared PinPad
- @xenia/ui PinPad: variable length (minLength/maxLength, OK key, Enter)
- e2e manager.mjs: 33 checks (+ lockout after 5 wrong PINs, PIN login mode,
  support access with a wrong then right code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:17:09 +02:00
bonaminandClaude Opus 5.5 df57fd1552 feat(manager): shell navigation from modules + permission keys; profile menu language
Platform-v2 step 2.6a:
- shell/nav.js: one nav definition (module + key per page) read by the sidebar,
  the page titles and a RouteGuard around the layout outlet (and /kds): a module
  that's off hides its items and its routes say "turned off"; a missing key
  hides the item and the route says "no access". Same keys as before (v1
  permission names mapped), plus the module check
- labels/breadcrumbs are keys in a new i18n namespace `manager` (en + el)
- removed the browser-only feature toggles (usePhase2Features, Settings ->
  Λειτουργίες, F-033), PermissionGuard and usePermissions
- profile menu: language, saved to the profile (PATCH /api/auth/me) and
  bootstrap reloaded
- e2e manager.mjs: module off/on, no-key user, language switch live + saved

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:48:08 +02:00
bonaminandClaude Opus 5.5 78c8824356 feat(api): @xenia/api + @xenia/access; the manager logs in and loads bootstrap through them
Platform-v2 step 2.5 (APPS_PLATFORM D-7, D-10, §9):
- @xenia/api: createApiClient (app passes its axios; session/device headers,
  err.xenia codes, 401/offline hooks, manager-override retry: ask PIN, grant,
  retry once with X-Xenia-Override); errorMessage; createLiveClient = the
  waiter's WebSocket logic (cursor replay, backoff, online) moved unchanged
- @xenia/access: AccessProvider (bootstrap per session token, language +
  venue formats, translated ui labels, approval dialog), useAccess/useCan/
  useModule, Can, RequireModule
- i18n: errors namespace for every backend code (en/el, test vs core/errors.py),
  override/access texts
- manager: client from createApiClient, AccessProvider in a layout route,
  /kds behind RequireModule, usePermissions from bootstrap keys; login and
  unlock no longer treat a wrong password/PIN as "session ended" (a wrong
  lock-screen PIN used to log the manager out)
- waiter: useWebSocket is a thin wrapper over createLiveClient
- tests: api/access unit tests; new e2e suite tests/e2e/manager.mjs; CS-18

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 20:38:31 +02:00
bonaminandClaude Opus 5.5 dbb8d5f0f4 feat(i18n): @xenia/i18n translations, language resolution and venue-time formatting
Platform-v2 step 2.4 (APPS_PLATFORM D-11, D-12, §7.2, §8):
- i18next 26.7.2 + react-i18next 17.1.13 (exact); en/el locale files
  (common, dev); createI18n, I18nProvider, useLanguage, setUserLanguage
  (screen first, then PATCH /api/auth/me through an app-provided save)
- resolveLanguage: user -> device -> venue -> en
- useFormat(): dates/times always in the venue zone from bootstrap (24 h,
  DST-safe, business dates never shifted), relative times, money and
  numbers per language; parseNumber accepts a comma or a dot
- scripts/check-i18n.mjs guard: keys missing in en, placeholder mismatches,
  dates formatted without the venue zone in new code (fails); missing el (warns)
- @xenia/ui components read their texts from UiLabelsProvider; useUiLabels()
  supplies the translated set
- dev-only /i18n-sample in the manager; ui.mjs e2e checks it with the browser
  in New York; unit tests in run-all; lockfile keeps both apps' versions
- new pack rule CS-17

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:51:11 +02:00
bonaminandClaude Opus 5.5 3580f2815c feat(ui): @xenia/ui design tokens, Tailwind preset and base components
Platform-v2 step 2.3 (APPS_PLATFORM D-15 §9):
- tokens.css: --x- prefixed colours (light/dark/system + 5 venue accent themes),
  spacing, radius, type scale, shadows, motion, z-index; variables only
- components.css: .x-* classes only, no element selectors (new rule CS-16)
- Button, IconButton, Dialog, Sheet, Toast, PinPad, InfoTip, EmptyState,
  Spinner, Field/Input/Textarea/Select, Switch (accessible: focus trap and
  restore, ARIA wiring, 44px targets)
- tailwind-preset.js (adds names only); manager uses it + styles.css, the
  waiter imports tokens.css; existing screens unchanged
- dev-only /ui-gallery in the manager; e2e suite tests/e2e/ui.mjs; unit tests
  for PIN rules and WCAG AA contrast of every token pair, both in run-all

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:33:58 +02:00
bonaminandClaude Opus 5.5 c7102f1c89 feat(manager): upgrade to React 19, React Router 7 and Vite 8 (same versions as the waiter)
Platform-v2 step 2.2: react/react-dom 19.2.5, react-router-dom 7.14.1, vite 8.0.9,
@vitejs/plugin-react 6.0.1, and react-is 19.2.5 (recharts' peer dependency, no
longer installed implicitly). React and the router are now shared by both apps
at the workspace root; the waiter resolves exactly the versions it had.
- .npmrc legacy-peer-deps for the whole workspace (vite-plugin-pwa 1.2 does not
  list Vite 8 yet; the waiter always installed this way)
- manager Vite dev/preview proxies /api, /api/ws and /static to :8000 like the waiter
No code changes were needed: every route renders and the main flows work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:27:10 +02:00
bonaminandClaude Opus 5.5 905c2955b0 chore(build): frontends become one npm workspace; images build from client-services/
Platform-v2 step 2.1 (APPS_PLATFORM D-15):
- root package.json with workspaces (packages/*, waiter_pwa, manager_dashboard)
  and empty @xenia/{ui,i18n,api,access} skeletons (filled in 2.3-2.5)
- one root package-lock.json generated from the two old app locks, so every
  dependency keeps its exact version (a fresh resolve moved the Capacitor and
  Capgo native plugins and broke UI-bundle updates); apps keep nested trees
- waiter/manager Dockerfiles build with context client-services/ (npm ci per
  workspace), root .dockerignore replaces the per-app ones; manager on node 22
- Vite dedupes react/react-dom so source-imported packages share the app's React
- waiter eslint ignores build outputs and the Android project

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:47:29 +02:00
bonaminandClaude Opus 5.5 ab1e61a10f feat(backend): UTC time model - venue zone, business date, aware-only datetimes
Platform v2 step 1.1 (APPS_PLATFORM D-11, §7, D-24).
- core/timeutil.py: utcnow, venue_tz (venue.timezone, cached, invalidated on
  change - no restart), to_venue/venue_date/venue_strftime, parse_api_datetime
  (offset -> UTC; naive = venue-local; date = venue midnight), business_date_of
  /business_date_window (rollover hour, default 06:00), LocalClock + is_within,
  UTCDateTime column type (naive writes raise, reads are aware UTC), iso_z
- every model column is UTCDateTime; Pydantic UTCDatetime emits "...Z"
- business_days.business_date set at open; revision 0002 adds it (backfilled)
  and makes sync_events.created_at a UTCDateTime (AUTOINCREMENT restated)
- tz.py deleted; system.timezone setting replaced by venue.timezone (validated)
  + business_day.rollover_hour; manager timezone picker writes venue.timezone
- fixes: price-group schedules/time_range used the container's zone (happy
  hour bug); traffic report bucketed by UTC hour; reports' "date" meant the UTC
  calendar day, now the business date; reservations stored venue-local naive
  times (no-show check 2-3 h off) and listed by func.date; schedule week used
  UTC midnights; fiscal file names used container-local time
- seed.py/demo_seed.py create store_manager with role permissions (regression
  from step 1.0: v1's startup ALTER list used to rename/grant role 'manager')
- tzdata dependency; guard tests/guards/test_no_naive_time.py (AST scan);
  tests/test_timeutil.py covers the §7.3 DST cases and the API checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:12:35 +02:00
bonaminandClaude Opus 5.5 0ec3d4735b feat(manager): license banners for offline licensing (KI-006)
Expiry reminders from 14 days (was 5) with a 'connect the server to the
internet to renew' hint while offline; banners for a clock set back and for
a not-yet-verified license; a quiet note after 7+ days without cloud contact
stating the system keeps working until the license date. Grace period
banner respects grace_over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:16:32 +03:00
bonaminandClaude Opus 5.5 251cac9807 chore: retire the per-client domain setup (plan step 9); addresses → bonamin.net
- remove setup-ssl.sh (mkcert IP certs) - superseded by install.sh's
  self-signed cert and the backend-managed TLS identity
- manager: "Waiter Domain (παλιό σύστημα)" - shown only for sites that
  still have one
- .env.example: REGISTRY=registry.bonamin.net and
  CLOUD_URL=https://xenia-api.bonamin.net (it pointed at the admin panel,
  xenia-admin, even before the domain move); install.sh points to the
  sysadmin panel at xenia-admin.bonamin.net
- pack README registry example updated
Proxy config unchanged (HTTPS domain blocks stay so not-yet-migrated sites
keep working until their visit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 19:06:45 +03:00
bonaminandClaude Opus 5.5 7811bf5dcb feat(manager): pairing QR carries the server's TLS key pin (&k=)
The native app refuses a server whose key differs from the QR, then talks
to it encrypted on :8443.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 17:41:25 +03:00
bonaminandClaude Opus 5.5 676a725807 feat(manager): "Τοπικό δίκτυο" card - server IP source, override editor, DHCP-change warning
App Info gets its own LAN card: the IP phones use and where it comes from
(manual / automatic detection / .env / browser address), an inline editor
to pin it or return to automatic, a note when detection is unavailable
(Docker Desktop, helper stopped/stale), and an amber warning with a one-click
fix when the pinned address is no longer this machine's. Waiter URL + pairing
QR and manager URL moved here from the System grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 16:13:17 +03:00
bonaminandClaude Opus 5.5 5230606144 feat(manager): show LAN waiter/manager addresses and pairing QR in App Info
App Info now lists 'Σερβιτόροι (WiFi)' http://<LAN IP> with a QR code
encoding http://<LAN IP>/?pair=<site_id> (phone camera opens the waiter app;
the native app will read the same code) and 'Διαχείριση (WiFi)'
http://<LAN IP>/manager. The LAN IP comes from HOST_IP, else from the
dashboard's own address when opened by IP; otherwise a hint to set HOST_IP.
QRModal takes an optional caption; the legacy waiter-domain QR is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:50:29 +03:00
bonaminandClaude Sonnet 5 934fda9405 feat: push product images to cloud for the QR menu
local_backend now uploads each product's image file to cloud_backend
during the existing ~5 min menu sync, so the QR menu can show real
photos without needing a manually-set digital_image_url. Only
re-uploads images whose content hash changed since the last push
(Product.cloud_image_hash), to avoid re-sending unchanged binaries
every cycle.

Also adds a manual "sync now" trigger (POST /api/system/sync-menu) and
a matching button in Settings → Operation, for pushing menu/price/image
changes immediately instead of waiting for the next automatic cycle.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 20:51:52 +03:00
bonaminandClaude Sonnet 5 34ae328b0d feat: bump client-services (accumulated feature work + deploy fixes)
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>
2026-07-19 10:00:14 +03:00
bonaminandClaude Sonnet 4.6 02ec1aa28f feat: ShiftDetailModal rework, Today cancellation events, shift details icon button
- Backend: add cancellation_events (row count) to _enrich_shift and shift summary
- Backend: add cancellation_events field to current business day endpoint
- Today tab: hero number now shows cancellation_events (distinct cancel actions),
  sub-label shows 'X παραγγελίες / Y είδη'
- ShiftsOverview: Λεπτομέρειες button is now icon-only (Eye, light blue) matching
  the delete button style
- ShiftDetailModal: modal widened to 1080px; ΠΑΡΑΔΟΘΗΚΑΝ KPI replaced with
  Ακυρώσεις showing 'X events / Y items'; all filter labels renamed (Πλήρης
  Παραγγελία, Μόνο Πληρώθηκε, Μόνο Παρήγγειλε, Ανοιχτό ακόμη); new Ακυρώθηκε
  filter added; cancelled items shown in red, Πληρώθηκε line hidden for cancelled;
  legend updated; classify() handles cancelled status before other checks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 17:48:30 +03:00
bonaminandClaude Sonnet 4.6 8533a1452b fix: report cancellation bugs + missing OrderItem model columns
Backend:
- OrderItem model: add cancelled_at, cancelled_by, cancel_reason columns
  (migration existed but model was missing them — caused 500 on cancellations_log)
- shifts.py _enrich_shift: count cancellations by quantity sum (not row count),
  add cancellation_value (sum of unit_price * quantity)
- reports.py current business day: add cancelled_items count (per-item quantity sum,
  across all orders in the day, not just fully-cancelled orders)

Manager dashboard:
- PrintFontsTab: fix SSE auth token key (access_token → manager_token, was causing 403)
- Today: show cancelled_items count as sub-label on Ακυρώσεις stat card
- OrderHistory: items/cancellations columns now use quantity sum, not row count
- WorkDaySummary drill-down: same quantity-sum fix
- ShiftsOverview: add Αξία Ακυρ. column next to Ακυρώσεις

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 17:15:55 +03:00
bonaminandClaude Sonnet 4.6 36e9044972 fix: two bugs in cancellation settings
- settings.py: add orders.waiter_cancellations_allowed to VALID_SETTINGS
  (was missing, causing 400 on every PUT attempt)
- StaffTab.jsx: include can_cancel_orders in edit waiter mutation payload
  (was omitted, so the checkbox change was never sent to the backend)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 12:55:48 +03:00
bonaminandClaude Sonnet 4.6 8a5a6f8be9 feat: Feature 2 — waiter order cancellation + report updates
Backend:
- Add can_cancel_orders to User model and schema
- Add global orders.waiter_cancellations_allowed setting (migration)
- Cancel endpoints: mark items with cancelled_by/cancelled_at, fire cancellation print
- print_cancellation_ticket: routes to same printer zones, prints ΑΚΥΡΩΣΗ banner
- Fix cancellations_log: date filter, waiter filter, join syntax
- shift/orders: add cancellations count and hours_worked per waiter
- _enrich_shift: add cancellations count to shift data
- Add cancel-permissions endpoint for PWA

Manager dashboard:
- Global cancel setting toggle in Settings > Operation > Shift Settings
- Per-waiter can_cancel_orders checkbox in staff modal
- Manager cancel flow: print confirmation prompt (Ναι/Όχι) in DashboardPage
- ShiftsOverview: Ακυρώσεις column per shift
- Activity: multi-bar chart with ORDERS/ITEMS/CANCELLATIONS/ΕΣΟΔΑ/ΩΡΕΣ checkboxes,
  grouped/stacked switch, right X-axis for hours, full waiter name on hover
- OrderHistory: cancelled items count column per order
- WorkDaySummary drill-down: cancelled items column in orders tab

Waiter PWA:
- Replace 3 pills with CLEAR | ALL | ACTIONS
- ACTIONS opens ItemActionModal for selected items
- ItemActionModal: ORDER AGAIN, MOVE TO OTHER TABLE, SPLIT, CANCEL ORDER
- ActionsSheet: Cancel Παραγγελίας option (greyed if no permission)
- CancelConfirmModal: requires confirmation before cancelling
- TableListPage: cancel order from long-press quick modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 12:47:02 +03:00
bonaminandClaude Sonnet 4.6 b5b647422a feat: subnet printer discovery (Feature 3)
- New GET /api/system/printers/scan SSE endpoint: parallel async TCP
  scan of a /24 subnet, streams found/progress/done events
- New GET /api/system/printers/scan-hints: returns auto-detected local
  subnets from socket.getaddrinfo, excludes loopback/docker ranges
- FindPrintersModal in Settings > Print: shows subnet+port inputs,
  live progress bar, found printers list; selecting a result pre-fills
  the new printer form (user still names it before saving)
- "Εύρεση εκτυπωτών" button added next to "+ Νέος εκτυπωτής"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 11:14:37 +03:00
bonaminandClaude Sonnet 4.6 f3d03bf85f feat: printer duplicate copies setting (Feature 1)
- Add `duplicates` column (0-9) to printers table via migration
- Print loop repeats job 1+duplicates times per printer zone
- PrinterForm in Settings > Print now has ΑΝΤΙΓΡΑΦΑ (0-9) field
- PrinterRow shows amber badge when duplicates > 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 10:55:43 +03:00
bonaminandClaude Sonnet 4.6 72b12ddd9c fix: fix timezone handling across backend and frontend (v0.3.1)
- Add tz.py with local_strftime/to_local helpers that read system.timezone
  from DB and convert UTC datetimes to venue local time before formatting
- Fix all strftime() calls in orders.py, reports.py, printer_service.py
  that were formatting UTC datetimes without timezone conversion
- Fix get_order endpoint returning raw dicts without Z suffix on datetimes,
  causing JS new Date() to treat timestamps as local instead of UTC
- Fix fmtDate() in tokens.js that stripped the T separator before parsing,
  breaking UTC-to-local conversion for all report date displays
- Make open/partially_paid table chips more visually distinct on dashboard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 19:18:46 +03:00