Commit Graph

31 Commits

Author SHA1 Message Date
a3aa71348e minor tweaks to the PORTS 2026-05-02 21:21:24 +03:00
c9ad78ec71 Waiter PWA fixes, and extra feautures. Also added Emergency Mode, search etc 2026-05-02 21:08:53 +03:00
8e27b7666e general fixes and ordering display overhaul 2026-04-30 16:58:13 +03:00
1fd7d16ec9 fix vite icons for PWA install 2026-04-29 17:14:07 +03:00
240abb2e73 Added Printer Spoofer for testing purposes 2026-04-29 16:45:09 +03:00
bb39088464 Frontend overhaul: manager dashboard restructure, waiter PWA rework, new order drawer and components
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 12:12:23 +03:00
defc49f84f Backend overhaul: new models, routers, schemas for shifts, business day, flags, messages, settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 12:12:05 +03:00
603fd45eaa Overhaul of the frontend on waiters, orders, and payment events
Manager Dashboard: product reorder/bulk actions, preference sub-choices
UI, expanded reports with DateInput component, waiter management updates,
order detail improvements, Docker config and backend dockerignore added.

Backend: table groups, auto-numbering, has_active_order flag, expanded
reporting endpoints, waiter zone management, user schema updates, system
router additions, table router fixes.

Waiter PWA: TableDetailPage order/payment event improvements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:37:34 +03:00
ee51e52acf Waiter PWA: UX polish — table names, category colours, print ack, PIN fix
- TableCard: show table.label (display name) instead of internal number
- TableListPage: zone filter rows 50% taller; table cards capped at 132px
  max-height so single-table zones don't stretch; grid aligns to top
- ProductPicker: category tabs use their configured colour (inactive=35%
  opacity); new View All button opens a full-screen category tile modal
- AddItemsPage: show per-printer print acknowledgement after sending order;
  print failures keep items as drafts and show a clear error screen
- PinPad: reduced to 4 dots/digits with auto-submit on 4th digit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:35:22 +03:00
26c4818aa1 Backend: synchronous print status on add_items
add_items now runs printer routing synchronously and returns
{ order, print_results } so the waiter PWA can show per-printer
ack or failure without guessing. Extracted _do_route_and_print
so the background-task path (route_and_print) is unchanged for
other callers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:35:08 +03:00
da29d73520 chore: gitignore FISCAL-DRIVER-TESTS/ and data/
FISCAL-DRIVER-TESTS/ contains vendor driver docs and test files that
don't belong in source control. data/ holds the SQLite databases and
uploaded product images — runtime-generated, not source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:33:45 +03:00
c92fc27ad0 Docs: fix whitespace alignment in PROJECT_REFERENCE.md ASCII diagram
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:32:13 +03:00
97d72a5868 Manager Dashboard: product reorder/bulk actions, preference sub-choices UI
ProductsPage:
- Drag-free reorder via ▲/▼ buttons (calls PUT /products/reorder)
- Sort toolbar: custom order / name / price
- Show/hide inactive products toggle
- Multi-select mode with bulk available/unavailable/hard-delete actions
- Preference sets: default_choice_index picker, shared_subset editor
  (set-level sub-choices shared across choices, with disables_subset per choice)
- Inline sub-choice editor for both checkbox options and preference choices
  (SubChoiceRows component with reorder, default toggle, price stepper)
- Hard delete + soft deactivate distinction in the delete confirmation dialog
- PriceInput component with −/+ steppers (0.10 increments)

TablesPage:
- Table groups gain prefix and color fields in create/edit form
- Color swatch picker for group color

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:29:24 +03:00
5acd880e92 Waiter PWA: sub-choices in modal, zone filter, login JSON fix
ItemOptionsModal:
- Supports inline sub-choices on both preference choices and checkbox options;
  sub-choices appear indented when the parent is selected
- Supports shared_subset at the preference-set level (shown unless the selected
  choice has disables_subset)
- Pre-selects default choices and their default sub-choices on open
- Add button disabled + red validation hints until all required selections made
- Price total reflects sub-choice extra_cost

TableListPage:
- Zone filter dropdown with multi-select; filters by table group_id
  (fetches /api/tables/groups alongside tables and orders)
- Fixed 'mine' and 'free' filters to compose correctly with zone filter

LoginPage:
- Switch to JSON body { username, pin } to match updated /api/auth/login
- Read user fields from data.user.* instead of flat response

vite.config.js: enable SW devOptions so PWA works in dev mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:29:09 +03:00
d07c7634e6 Backend: table groups with prefix/color, auto-numbering, has_active_order flag
TableGroup gains prefix and color columns for display in the PWA zone filter.
Table creation now assigns a global auto-increment number; batch creation uses
group-local label numbering (avoids gaps/conflicts when adding to existing groups).
DELETE table now blocks if an active order exists (soft or hard delete).
Hard delete cascades past orders before removing the table row.
list_tables enriches each TableOut with has_active_order computed server-side.
TableOut no longer requires number in the input payload; TableCreate simplified.

Migration runner refactored to give each ALTER TABLE its own connection so a
no-op (column already exists) doesn't leave a dirty transaction blocking later
migrations. New migrations added for all new columns.

Order.print_logs relationship gains cascade="all, delete-orphan" so print logs
are removed when an order is deleted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:28:56 +03:00
2c9276e654 Backend: product sub-choices, sort_order, preference shared_subset, hard-delete
- ProductOption and ProductPreferenceChoice gain sub_choices (JSON Text column)
  for nested inline choices shown when the parent is selected
- ProductPreferenceSet gains default_choice_id and shared_subset (set-level
  sub-choice group shown for all choices that don't disable it)
- Product gains sort_order column; list endpoint orders by sort_order
- New PUT /products/reorder endpoint for drag-and-drop ordering
- DELETE /products/{id} now accepts ?hard=true for permanent deletion (blocked
  if product appears in any past order)
- Schemas updated with model_validators to parse stored JSON back to typed objects
- Add python-multipart to requirements (needed for file upload form parsing)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:27:16 +03:00
5dbb775308 Backend: move JWT logic to deps.py, fix circular import in auth
Token creation/decoding/blacklisting was split across auth.py and deps.py
causing a circular import. Consolidate make_token, decode_token, and
blacklist_token in deps.py; auth.py now imports from there.
Also switches /login to accept JSON body (username+pin) instead of
form-encoded, and returns a proper user object in the response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:26:49 +03:00
e283b8b50f Docs: add PROJECT_REFERENCE, TESTING_CHECKLIST, update session instructions for Phase 4+5 completion 2026-04-20 20:38:11 +03:00
e0b0a04819 Phase 5: scaffold Sysadmin Panel — all pages, layout, routing, docker-compose service 2026-04-20 20:17:59 +03:00
9812a25198 Phase 4: cloud backend — licensing, heartbeat, site management
- New cloud_backend/ FastAPI service on port 8001 (SQLite for dev, swappable to PostgreSQL)
- Endpoints: sysadmin auth (JWT), site registration, lock/unlock, heartbeat (X-Site-ID + X-Site-Key headers)
- Default sysadmin seeded on first startup from ADMIN_USERNAME/ADMIN_PASSWORD env vars
- cloud_backend added to docker-compose.yml with persistent data volume at ./data/cloud/
- local_backend cloud_sync.py updated to use correct /api/heartbeat/ endpoint with header auth
- local_backend config.py: added SITE_KEY setting
- Smoke tested: login, register site, heartbeat, lock, unlock, list all pass
2026-04-20 19:05:14 +03:00
10b44d9a1a Update session instructions: Phase 3 complete, document all fixes and known issues 2026-04-20 18:47:49 +03:00
24a029a8cc Fix order saving, isMyOrder, blocked waiters, options pricing; add preferences, table groups, product images
Backend:
- OrderItemInput accepts option objects {id,name,price_delta} instead of int IDs
- extra_cost from selected options added to unit_price snapshot
- GET /api/products/?all=true for manager (includes unavailable)
- PUT /api/products/{id} now replaces options, ingredients, preference_sets
- POST /api/products/{id}/image — persistent image upload to /app/data/product_images
- New models: ProductPreferenceSet, ProductPreferenceChoice, TableGroup
- tables: group_id FK, hard delete (?hard=true), batch create POST /api/tables/batch
- GET /api/tables/groups + POST/PUT/DELETE groups endpoints
- POST /api/auth/me endpoint for token rehydration
- Auto-migration on startup for new columns

PWA:
- AuthRehydrator: fetches /auth/me on load so isMyOrder works after page reload
- 401 response force-logs out (covers blocked waiters)
- ItemOptionsModal: uses extra_cost correctly, shows preferences as radio buttons

Manager:
- ProductsPage: shows unavailable products greyed out, category color picker + reorder,
  full option/ingredient/preference editing, image upload
- TablesPage: table groups, auto-increment, deactivate vs hard delete, batch add
2026-04-20 18:39:51 +03:00
8f52156f5b Phase 3: scaffold Manager Dashboard — all pages, layout, routing
Includes: LoginPage (PIN pad), DashboardPage (30s polling table grid),
OrderDetailPage (full actions), ProductsPage (CRUD + printer zone),
WaitersPage (block/reset PIN/delete), TablesPage, ReportsPage
(shift summary + order history + CSV export), SettingsPage (printers
+ test print + sysadmin lock/unlock). TailwindCSS, React Query,
react-hot-toast. Docker Compose service on port 5174.
2026-04-20 17:20:46 +03:00
7f5bcfe4e1 Update session instructions: document Phase 2 completion, fixes, and dev data 2026-04-20 12:25:26 +03:00
e9b4cfcd26 Fix order item names, add Select All, pay confirmation with total, close empty order 2026-04-20 12:22:36 +03:00
79f316aeb7 Mark Phase 2 complete 2026-04-20 12:03:48 +03:00
36cc67dbbc Phase 2: scaffold Waiter PWA — React+Vite, PWA manifest, all pages and components 2026-04-20 12:03:26 +03:00
803358e52c Mark Phase 1 complete 2026-04-20 11:43:45 +03:00
24e80813bb Add seed script for first manager account and printers 2026-04-20 11:43:15 +03:00
679d36ab5b Fix SQLite path: use AppData on Windows, posix paths for Linux/Docker 2026-04-20 11:30:20 +03:00
4ffe27df95 Phase 1: scaffold local backend — models, schemas, routers, printer service, Docker 2026-04-20 11:22:55 +03:00