Skip to content
Articles
Article

Offline POS: store stock as a ledger, not a counter

by Stacklyn Labs dev.to

2 min read

Here is a stock bug that throws no error, passes every single-device test, and still loses inventory. The counter model The obvious model is a number on the product: product.stock = 12; // on each sale: product.stock -= quantitySold; On one device it works. Now add a second till, and let both work offline. Both tills start with stock = 12. Till A sells 2, so it stores 10. Till B sells 3, so it st…

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

FlutterX is supported by