System design for inventory management system to ensure no negative stocks
I’m developing inventory management software. Currently I’m researching ways to ensure its impossible to have negative supplies. Given the simplest transactions types like: increase items count for a given item for a given warehouse, reduce it and transfer from one warehouse to another. And the possibility for a user to create, delete and update those transactions, including dates, items lists, quantities and warehouses – I can see no other way rather than on each change to recalculate entire set of transactions for given items+warehouses. However it is obviously not a scalable way to manage this.