I'm building a shop for a roadhelp company an I'm stuck on how to connect two of my Entities in the best way.
Here is a brief summary of the Entities:
Orders: This is where all the basic order data is. (PK = orderid, ipaddress, etc)
Product: This contains a productid as PK, name, price etc. This can be a subscription to a Roadhelp product but it can also be a showel you buy together with a subscription.
ProductinOrders: This contains foreign keys to Orders and Product. The PK is orderid, productid and weight. It also contains a field for whether or not the product can be removed from the order.
And now for the "bastard"...
I also have a Vehicle Entity where the PK are orderid (from Orders) and Licenseplate. The Entity contains data like Make, Model, Variant etc. (This data is retrieved when the customer enters the licenseplate in the form).
The customer should be able to buy as many subscriptions as he/she wants to in the same "flow". Therefore I need to keep Vehicle and the subscription Product in the ProductinOrders in sync.
To make a long story short... sigh
When the customer as entered the Licenseplate I need to be able to connect the licenseplate with a specific product.
Regards, Lars Hansen