I am trying to build a manufacturing management program in Ruby on Rails.
The goal is to collect orders and inventory, summarize the order's products into manufacturing batches and track the inventory that goes into those batches.
In thinking of how this goes together I came up with 6 databases that need to be tracked. Now how they all associate together is giving me a head ache.
Customer, Order, Product, Component (Or ingredient), Batch, and Inventory
Customers Have Many Orders Orders Have Many Products Products Have Many Components Batches are Summarized Orders Products Batches use inventory Inventory types are components Orders have batches Orders has inventory through batches
As you can tell that started solid and then fell all apart
So Here are all the relationships in story from
We have 10 Chocolate Cookies] in Box A 9 Chocolate Cookies in Box B 2 Vanilla Cookies in Box C 100 Units of cream in Box D
This adds up to we have 19 Chocolate Cookies, and 2 Vanilla Cookies and 100 Units of cream
For Tuesday Suzy for ordered 5 Oreos (2 chocolate cookies and 1 cream) also for Tuesday Adam 2 Oreos (2 chocolate cookies and 1 cream) and ordered 2 Vanilla Oreos (2 vanilla cookies and 1 cream)
So we need to make on Monday a batch of 7 Oreos and a batch of 2 Vanilla Oreos
These two boxes use 14 Chocolate Cookies, 4 Vanilla Cookies and 9 Units of Cream
At the end we will should have 5 Chocolate Cookies in Box 3232, 100 Units of cream in Box D and we will need to buy at least 2 Vanilla Cookies
Once it is all finished Suzy will have an order for an Oreo that came from a batch that used cookies from both box B and B
If you made it through all that rambling any help in how all of these database puzzle pieces fit together would be amazing.
Aucun commentaire:
Enregistrer un commentaire