Skip to content

Fix: Retrieve and Sync Held Orders Across Devices (Resolves #17) - #75

Merged
khaira777 merged 4 commits into
mainfrom
fix/issue-17-held-orders
Jul 11, 2026
Merged

khaira777 merged 4 commits into
mainfrom
fix/issue-17-held-orders

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Description

This PR resolves Issue #17 by properly persisting "Held Orders" into the SQLite database instead of keeping them isolated in local frontend state.

Why these architectural changes were necessary:

During review of the original held orders implementation, it was discovered that there was previously no way to retrieve or resume a held order across different devices. Because the held orders were only saved locally in the browser's Zustand store, if a server held an order on an iPad, a cashier at the main terminal would have no visibility into it, nor could they resume it to take payment.

To solve this fundamentally broken user journey without pushback, the following additions were required:

  1. New Database Table & API Routes (/api/held-orders): We must persist held orders centrally so that any device on the network can query the active held orders.
  2. New 'Held' Tab in the Orders Dashboard: Since any device can now view held orders, we needed a dedicated UI to display them. This provides crucial visibility into all held orders across the entire restaurant.
  3. 'Resume in POS' Action: The UI now includes a dedicated button to instantly pull a held order back into the active cart state on any device to finalize the transaction.

Testing

  • Added comprehensive integration tests in tests/held-orders.test.ts verifying CRUD operations across the new API route.
  • Verified state syncs correctly between the held-orders store and the cart store upon resumption.
  • All standard test suites pass.

@khaira777
khaira777 requested a review from itsbkm as a code owner July 11, 2026 01:41
@khaira777
khaira777 merged commit 47b00b9 into main Jul 11, 2026
10 checks passed
@khaira777
khaira777 deleted the fix/issue-17-held-orders branch July 11, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Held orders only stored in localStorage — invisible on Orders and Tables pages

1 participant