Hey all, I have built an app to order products and want to put an inventory system in place. Once an order is placed i would like the current order item quantity to be subtracted from the current items inventory. This way a list can be filtered to only show items which the inventory is not equal to 0 and to avoid items that are out of stock being ordered.
Sounds super easy but I do not know why i cannot figure it out! Someone please help.
This shows the database and flow in the app. There are categories which have items inside of them. A user creates an order and adds order items into the order.
This subtracting process is similar to online ordering, it is just you add stock property in products collection and do update action whenever transaction is saved.
Take a look at free cloneable app in Resources category.