Repository navigation
Fix: Retrieve and Sync Held Orders Across Devices (Resolves #17) - #75
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:
/api/held-orders): We must persist held orders centrally so that any device on the network can query the active held orders.Testing
tests/held-orders.test.tsverifying CRUD operations across the new API route.held-ordersstore and thecartstore upon resumption.