Database / inventory system

Hi everyone,

I’m wondering whether someone has experience/knows the solution to the following. I currently have an “amazon-like” app with a very basic inventory system. Every listing/item has an inventory count and a certain size. So, a listing can be a t-shirt in size Medium, with 5 items in stock. Now, I want different sizes for a single product. So, someone can upload a single sort of t-shirt in sizes S, M, and L for example.

So, first I had the data type “Listing”, with the fields “Size” and “quantity”. I figured that I could delete those fields and make the following types: Size XS, Size S, Size M, etcetera. Please correct me if this is the wrong approach.

Now, I’m wondering how I can display the sizes on a product page, so that a buyer is only able to select the size that is available, with for example a drop-down menu or buttons.

Overall tips for this type of database architecture are also very welcome!

1 Like