@kiwi0134 I’m not familiar with the episode/series you’re talking about, but have worked on plenty of e-commerce-type projects in the past.
Usually, I have a Product model that represents the common characteristics of a product, such as a T-shirt. I’ll then have a Sku model that represents a SKU, which is a single variant of any one product. If a T-shirt comes in different sizes, then you’ll usually have a SKU for each different size.
So when it comes to tracking inventory, you’ll want to track inventory against SKUs rather than products. How “deep” you go with this modelling depends on your requirements. If you need to track incoming deliveries from suppliers, then you may also need to track inventory against locations (i.e. warehouse, shop floor) so you can see just how many size L t-shirts you have in the warehouse, how many are on a shelf in your store, etc. When a delivery comes in, you increase the inventory in your warehouse. When a box is opened and put out on display, you transfer the inventory by deducting the number from warehouse and adding to the number on the shop floor. When a shirt is sold, you decrease the inventory from the shop floor.