Here, we are connecting Order with Product. To associate the two, we only need the IDs:
- Product ID
- Order ID
- Quantity
- Item amount (individual value)
- Tax amount (individual value)
- Total amount
We are saving the amount of one individual item as well as the tax for this one item. The total amount then is as follows:
total amount = quantity * (item amount + tax amount)
The total amount of Order will then be the sum of all Order Product IDs.