Warehouse architecture - how to manage it?

Hello everyone!
I hope this is the best place to ask questions like this :slight_smile: I am looking for a solution on how to properly implement warehouse architecture based on Django models.
Let’s assume the below points:

  1. Same items can be purchased at different prices and qty depending on the supplier and date
  2. Warehouse should store information about each item or purchase?
  3. During item sales, Django should look for all purchases and decrease stock for certain items

Looks simple? I don’t think so :stuck_out_tongue_winking_eye:

So I managed to make models like:
Item/Product → General information about item like color and image

OrderProduct → Store information about a certain product, purchase price, and qty

Order → Collect all OrderProduct which was purchased from one seller

Warehouse → No idea how to manage it

And this point looking for support how I should manage “selling” products from warehouse. Any ideas or tips?

I guess my first reaction to this is “Why are you trying to model the Warehouse?”

Do you have multiple warehouses where you need to manage inventory across the set?

Your Item model can track “number in stock” - there’s not generally a requirement to track that data elsewhere.

Now, if you’re managing inventory across multiple warehouses, that’s a different issue. Managing any “physical location” of a product within your inventory all fits into the same general principle. For example - you may wish to identify a “room” or “shelf number” or “location number” of that product within the warehouse - if it’s possible that that Item is present in multiple locations within the warehouse.

But I’m not seeing where that’s needed from what you’ve posted here.