Database Design | Add and Subtract calculation values on database collection

Hello Velo by Wix from the Philippines, I’m trying to create an inventory management system using Wix, where I have the Beginning history of the product, Deployment History, and Item Return History.

Questions:

  1. What will be the best approach of database design to handle those data comes from the Beginning history when the product is added and will set a new “Job Order Number” when this product is deployed and returned, so I can display it in a table for their history.

  2. What example functions I need to subtract and add the value from the database, For example, I have 100 Quantity items for Product A, and will subtract when I deploy 20 items and will add back when Item is returned, I’m new to Wix code with very minimal code experience, I will highly appreciate if anyone explained this with code sample, Thank you so much!

Here is my sample database structure

I’m sorry, but questions about (db)-design do not really belong here (and actually could not even be answered with such minimal info). Design is the hardest part. If you cannot do this, there are many Wix (certified) Partners who can help you or do it for you.