You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(server-app): forward table order moves - #1300
Implement the missing Server App (:3003) table-order move forwarder (POST /api/tables/:id/move-order with serverAppApiRateLimit and requireServerAppAuth), wire MoveTableModal into frontend/src/app/server-standalone/page.tsx with apiClient and formatPrice support and proper selectTable ref synchronization, and update docs/reference/api.md and tests/server-app-server-role.test.ts (Issue #1291). Follow Ponytail / YAGNI and Superpowers Obra TDD, validate through /no-mistakes, trigger @greptileai review this at apex on the PR, and resolve any review findings.
What Changed
Forward POST /api/tables/:id/move-order on the Server App (main/server-app.ts) with serverAppApiRateLimit and requireServerAppAuth, and update the Server App route inventory in docs/reference/api.md.
Extend MoveTableModal (frontend/src/components/tables/MoveTableModal.tsx) to accept optional apiClient and formatPrice props and disable header close and floor-filter controls while a move request is in flight.
Wire MoveTableModal into frontend/src/app/server-standalone/page.tsx when tables.orders.move is granted (including served active orders, /api/auth/me permission refreshes, and preserving pending send retry keys across table moves), and add backend, UI, and E2E test coverage.
Risk Assessment
✅ Low: The Server App table-order move forwarder, MoveTableModal integration, state/idempotency safeguards, documentation updates, and test coverage are well-bounded and match all acceptance criteria without defects.
Testing
Built the backend and static frontend, ran the Server App role integration suite (tests/server-app-server-role.test.ts), the MoveTableModal UI unit suite (tests/table-move-ui.test.ts), and the full 7-test Playwright E2E suite (frontend/e2e/server-app-ordering.spec.ts) against isolated Server App, KDS, and main POS servers, and captured reviewer-visible screenshots (server-app-move-table-modal.png, server-app-after-table-move.png) plus live API evidence (server-app-move-order-api.json); all checks and live scenarios passed.
Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario
Result
Live
Evidence
Authenticated server opens MoveTableModal on the Server App, views the active dine-in order (including served orders) with tenant currency formatting, and moves the order to an available destination t…
Adversarial auth and permission boundary: unauthenticated POST /api/tables/:id/move-order on the Server App is rejected with 401, the Move Table control stays hidden when tables.orders.move is omitted…
✅ pass
live
node tests/run-electron-node-test.cjs tests/server-app-server-role.test.ts, ~/.no-mistakes/evidence/01M5JM9WEDW633KW519NBAHTNG/server-app-move-order-api.json, and `npx playwright…
Adversarial UI and idempotency guards: tapping Move Table in the mobile ticket drawer closes the drawer before opening MoveTableModal, in-flight move requests disable the modal close/cancel buttons, a…
✅ pass
live
npx playwright test --config=playwright.config.ts --project=chromium e2e/server-app-ordering.spec.ts and npx ts-node --transpile-only -P tests/tsconfig.json tests/table-move-ui.test.ts
Evidence: Live Server App POST /api/tables/:id/move-order API response and auth rejection evidence
Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario
Result
Live
Evidence
Authenticated server opens MoveTableModal on the Server App, views the active dine-in order (including served orders) with tenant currency formatting, and moves the order to an available destination t…
Adversarial auth and permission boundary: unauthenticated POST /api/tables/:id/move-order on the Server App is rejected with 401, the Move Table control stays hidden when tables.orders.move is omitted…
✅ pass
live
node tests/run-electron-node-test.cjs tests/server-app-server-role.test.ts, ~/.no-mistakes/evidence/01M5JM9WEDW633KW519NBAHTNG/server-app-move-order-api.json, and `npx playwright…
Adversarial UI and idempotency guards: tapping Move Table in the mobile ticket drawer closes the drawer before opening MoveTableModal, in-flight move requests disable the modal close/cancel buttons, a…
✅ pass
live
npx playwright test --config=playwright.config.ts --project=chromium e2e/server-app-ordering.spec.ts and npx ts-node --transpile-only -P tests/tsconfig.json tests/table-move-ui.test.ts
cd frontend && E2E_TASK_LOCAL_PORTS=1 E2E_BASE_URL=http://127.0.0.1:43101 E2E_KDS_BASE_URL=http://127.0.0.1:43102 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43103 npx playwright test --config=playwright.config.ts --project=chromium e2e/server-app-ordering.spec.ts
Live Playwright browser capture against tests/e2e-server.cjs producing server-app-move-table-modal.png, server-app-after-table-move.png, and server-app-move-order-api.json
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
The Server App forwards table-order moves to the main POS API.
Servers can move an active order from the standalone ordering page.
A table move keeps a pending order send tied to its original retry key.
No new actionable issues found. The six earlier findings are addressed in the current code. This review used code inspection and git diff --check; builds, tests, and browser checks were not run.
Diagram
sequenceDiagram
participant Staff
participant Page as Server App page
participant Proxy as Server App :3003
participant API as Main API :3001
participant DB as SQLite
Staff->>Page: Choose destination table
Page->>Proxy: POST /api/tables/:id/move-order
Proxy->>Proxy: Check session and Server App access
Proxy->>API: Forward token and request body
API->>API: Check move permission
API->>DB: Move order and update both tables together
DB-->>API: Updated order and tables
API-->>Page: Move result
Page->>Page: Preserve retry key and select destination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1291
Intent
Implement the missing Server App (:3003) table-order move forwarder (POST /api/tables/:id/move-order with serverAppApiRateLimit and requireServerAppAuth), wire MoveTableModal into frontend/src/app/server-standalone/page.tsx with apiClient and formatPrice support and proper selectTable ref synchronization, and update docs/reference/api.md and tests/server-app-server-role.test.ts (Issue #1291). Follow Ponytail / YAGNI and Superpowers Obra TDD, validate through /no-mistakes, trigger @greptileai review this at apex on the PR, and resolve any review findings.
What Changed
POST /api/tables/:id/move-orderon the Server App (main/server-app.ts) withserverAppApiRateLimitandrequireServerAppAuth, and update the Server App route inventory indocs/reference/api.md.MoveTableModal(frontend/src/components/tables/MoveTableModal.tsx) to accept optionalapiClientandformatPriceprops and disable header close and floor-filter controls while a move request is in flight.MoveTableModalintofrontend/src/app/server-standalone/page.tsxwhentables.orders.moveis granted (includingservedactive orders,/api/auth/mepermission refreshes, and preserving pending send retry keys across table moves), and add backend, UI, and E2E test coverage.Risk Assessment
✅ Low: The Server App table-order move forwarder, MoveTableModal integration, state/idempotency safeguards, documentation updates, and test coverage are well-bounded and match all acceptance criteria without defects.
Testing
Built the backend and static frontend, ran the Server App role integration suite (
tests/server-app-server-role.test.ts), the MoveTableModal UI unit suite (tests/table-move-ui.test.ts), and the full 7-test Playwright E2E suite (frontend/e2e/server-app-ordering.spec.ts) against isolated Server App, KDS, and main POS servers, and captured reviewer-visible screenshots (server-app-move-table-modal.png,server-app-after-table-move.png) plus live API evidence (server-app-move-order-api.json); all checks and live scenarios passed.node tests/run-electron-node-test.cjs tests/server-app-server-role.test.ts, ~/.no-mistakes/evidence/01M5JM9WEDW633KW519NBAHTNG/server-app-move-order-api.json, and `npx playwright…npx playwright test --config=playwright.config.ts --project=chromium e2e/server-app-ordering.spec.tsandnpx ts-node --transpile-only -P tests/tsconfig.json tests/table-move-ui.test.tsEvidence: Live Server App POST /api/tables/:id/move-order API response and auth rejection evidence
{ "unauthenticatedMoveAttempt": { "status": 401, "body": { "error": "No token provided" } }, "authenticatedServerMoveViaUi": { "status": 200, "url": "http://127.0.0.1:43203/api/tables/tbl-8f0f263e/move-order", "order": { "id": 1, "order_number": "ORD-20261023-0001", "table_id": "tbl-96737391", "total": 128.4 }, "sourceTable": { "id": "tbl-8f0f263e", "name": "Table 10", "status": "available" }, "targetTable": { "id": "tbl-96737391", "name": "Table 11", "status": "occupied" } } }Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
node tests/run-electron-node-test.cjs tests/server-app-server-role.test.ts, ~/.no-mistakes/evidence/01M5JM9WEDW633KW519NBAHTNG/server-app-move-order-api.json, and `npx playwright…npx playwright test --config=playwright.config.ts --project=chromium e2e/server-app-ordering.spec.tsandnpx ts-node --transpile-only -P tests/tsconfig.json tests/table-move-ui.test.tsnode tests/run-electron-node-test.cjs tests/server-app-server-role.test.tsnpx ts-node --transpile-only -P tests/tsconfig.json tests/table-move-ui.test.tsnpm run build && npm run build:frontendcd frontend && E2E_TASK_LOCAL_PORTS=1 E2E_BASE_URL=http://127.0.0.1:43101 E2E_KDS_BASE_URL=http://127.0.0.1:43102 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43103 npx playwright test --config=playwright.config.ts --project=chromium e2e/server-app-ordering.spec.tsLive Playwright browser capture againsttests/e2e-server.cjsproducingserver-app-move-table-modal.png,server-app-after-table-move.png, andserver-app-move-order-api.json✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.