A cashier can lose connectivity after submitting a sale. At that point, the app may have no response even though the server recorded the transaction. When I worked on Devify POS, the Android checkout and receipt flows made this a practical design question. Offline synchronization is still being developed. These are the checks I would use to verify it.
1. Retry the same sale
Give each checkout attempt a stable ID. If the server already accepted that ID, a retry should return the existing sale. Test by dropping the connection after the server accepts the request, then submitting again. Check that there is one sale and one set of stock movements.
2. Keep stock movements tied to the sale
At the API boundary, record the sale and its inventory movements in a single database transaction. Test with two variants of the same product. Sell one variant and verify that its stock changes exactly once and the other variant stays untouched.
3. Reprint without running checkout again
A disconnected printer should leave the sale visible so the cashier can reprint it from the existing record. Test by turning off the printer during checkout and reconnecting it. Verify that the reprint uses the original sale reference.
These checks apply to any Android checkout backed by a Laravel API. My web and mobile project work is available at Programmings 360.
Top comments (0)