Update session instructions: Phase 3 complete, document all fixes and known issues

This commit is contained in:
2026-04-20 18:47:49 +03:00
parent 24a029a8cc
commit 10b44d9a1a

View File

@@ -36,7 +36,7 @@ We are building a local-first restaurant POS system. Full architecture and specs
> Update this line as you progress: > Update this line as you progress:
> Phase 1: Local Backend — [x] Complete. Smoke tested: health, auth, products, tables, orders, printer routing all working. > Phase 1: Local Backend — [x] Complete. Smoke tested: health, auth, products, tables, orders, printer routing all working.
> Phase 2: Waiter PWA — [x] Complete. Smoke tested end-to-end: login, table list, open order, add items, select/pay with confirmation, close order. See "Phase 2 Known Issues & Fixes" below. > Phase 2: Waiter PWA — [x] Complete. Smoke tested end-to-end: login, table list, open order, add items, select/pay with confirmation, close order. See "Phase 2 Known Issues & Fixes" below.
> Phase 3: Manager Dashboard — [ ] Not Started > Phase 3: Manager Dashboard — [x] Complete. Scaffolded and smoke tested. Known issues remain (see below) — not blockers for Phase 4.
> Phase 4: Cloud Backend — [ ] Not Started > Phase 4: Cloud Backend — [ ] Not Started
> Phase 5: Sysadmin Panel — [ ] Not Started > Phase 5: Sysadmin Panel — [ ] Not Started
@@ -45,13 +45,37 @@ We are building a local-first restaurant POS system. Full architecture and specs
- `OrderOut` schema now includes `waiters: List[OrderWaiterOut]` — required for `isMyOrder` check on the frontend. - `OrderOut` schema now includes `waiters: List[OrderWaiterOut]` — required for `isMyOrder` check on the frontend.
- Close order button is enabled when there are zero active items (not just when all are paid) — allows closing an empty order. - Close order button is enabled when there are zero active items (not just when all are paid) — allows closing an empty order.
- Printing silently skips items with no `printer_zone_id`**expected**. Printer zones are assigned in Phase 3 (Manager Dashboard). No code change needed. - Printing silently skips items with no `printer_zone_id`**expected**. Printer zones are assigned in Phase 3 (Manager Dashboard). No code change needed.
- `selected_options` and `removed_ingredients` on `OrderItemInput` accept `List[dict]` from the PWA (name+price_delta objects and name strings respectively), stored as JSON in the DB. The printer service reads them as raw JSON — modifier names print correctly. - `selected_options` and `removed_ingredients` on `OrderItemInput` now accept `List[dict]` from the PWA (name+price_delta objects and name strings respectively), stored as JSON in the DB. The printer service reads them as raw JSON — modifier names print correctly.
## Phase 3 — What Was Built
- Manager Dashboard: React+Vite, TailwindCSS, React Query, react-hot-toast. Port 5174.
- Pages: Login (PIN pad, manager/sysadmin only), Dashboard (live table grid, 30s polling), OrderDetailPage (full actions), ProductsPage, WaitersPage, TablesPage, ReportsPage, SettingsPage.
- Docker Compose service added.
## Phase 3 Known Issues & Fixes Applied
- `isMyOrder` was always false after page reload — fixed: `AuthRehydrator` fetches `/auth/me` on app load to rehydrate user from token.
- `OrderItemInput` schema mismatch fixed: backend now accepts `selected_options` as `List[{id, name, price_delta}]` objects (not int IDs).
- Blocked waiter now force-logged out of PWA on next request (401 interceptor).
- `opt.price_delta` fixed to read `opt.extra_cost` from backend schema.
- `GET /api/products/?all=true` added for manager to see unavailable products (greyed out, not hidden).
- `PUT /api/products/{id}` now replaces options, ingredients, and preference_sets.
- New: ProductPreferenceSet + ProductPreferenceChoice models (exclusive-choice per product).
- New: Product image upload — POST `/api/products/{id}/image`, stored at `/app/data/product_images`, served as static files. Docker volume: `./data/product_images:/app/data/product_images`.
- New: TableGroup model + endpoints (`/api/tables/groups`). Tables have `group_id` FK.
- New: `DELETE /api/tables/{id}?hard=true` for permanent delete vs deactivate.
- New: `POST /api/tables/batch` for bulk table creation with prefix + count.
- New: `POST /api/auth/me` endpoint.
- Auto-migration on startup adds new columns to existing SQLite DB without dropping data.
## Phase 3 Known Remaining Issues (to revisit)
- Some PWA/manager interactions still have rough edges — to be addressed in a dedicated polish pass before or after Phase 5.
- Product image upload requires the product to already exist (no upload on creation, only on edit).
## Phase 2 Dev Data (seeded manually, not in seed.py) ## Phase 2 Dev Data (seeded manually, not in seed.py)
- Tables 16 exist (table 1 was from Phase 1 smoke test) - Tables 16 exist (table 1 was from Phase 1 smoke test)
- Category "food" (id=1) exists from Phase 1 smoke test — contains product "arakas" - Category "food" (id=1) exists from Phase 1 smoke test — contains product "arakas"
- Categories: Ποτά, Σαλάτες, Κυρίως — 3 products each - Categories: Ποτά, Σαλάτες, Κυρίως — 3 products each
- No printer zones assigned to any product yet - Printer zones can now be assigned via ProductsPage in the Manager Dashboard.
## Environment Variables ## Environment Variables