简体   繁体   中英

design decision for inventory system

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?

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:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM