Reputation: 10769
That's my class diagram at the moment:
I believe I can control the level of stock at each venue by the difference between the quantity of purchased ingredient and the quantity of beverage sold (as each beverage is composed by ingredient).
However, I have a requirement that should allow users to transfer ingredients between venues, and I am wondering what is the best approach for that...
A new purchase order would add the product to one venue's inventory, but how can I remove it from the other one?
Upvotes: 1
Views: 10344
Reputation: 10769
Just in case someone get to this question, here goes my solution:
I decided to create a table transfer_stocks
to register all the transfers between venues. This table is also used to solve any discrepancy when stock is counted (when recipient_id
is nil, it means wastage or stock missing in the venue -sender_id
).
The products in stock is calculated by de difference between purchases, sales and stock transferred.
My class diagram:
Upvotes: 2