Skip to content

Adding, and Modifying Parts

randomcoder edited this page Jan 18, 2012 · 8 revisions

Some thoughts on parts, vehicles and suppliers.

This has been hard to think about from a MongoDb rather than a relational database mindset

In database terms there is a two way 1..* relationship between parts and suppliers, with a list of costs for a part depending on the individual suppliers cost.

  • Part(val partId: Identifier, val partName: String, val vehicle: Option[List[Vehicle]] = None)
  • PartCost(val part: Identifier, val suppliedCost: Double, val lastSuppliedDate: Date)
  • PartKit(val kitId: Identifier, val kitName: String, val parts: List[Part], val kitPrice: Double)
  • Supplier: supplierId(M), name(M), ContactDetails(M), suppliedParts: List[PartCost], Notes(O)

Adding/Modifying a Part

The web page for adding/modifying a new part must include adding a new or existing PartCost, with an associated new or existing Supplier.

Adding/Modifying a Supplier

Left the concept of a Supplier being just supplier contact information, quotes made by a supplier for a part are in a new object PartCost

The web page for modifying supplier can also include a table listing all the PartCost objects associated with parts they supply via a query with the option of removing the PartCost from that table

Querying parts in terms of cost and suppliers

This should be easier as Part contains a list of all the PartCost for that part which contains the supplier id, cost and date are contained in the part object.

Vehicle

I am going to add the manual name and link to the vehicle, this will allow all the vehicle information to be kept together.

Clone this wiki locally