Overview
The OrderItem entity details a specific product and its quantity requested within an Order
. It holds information about the product, the quantity ordered, and the price calculation for that line item. OrderItems are part of the Order
aggregate.
Entity Properties
Name | Type | Required | Description |
---|---|---|---|
orderItemId | UUID | Required | Unique identifier for the order item |
orderId | UUID | Required | Identifier for the parent Order |
productId | UUID | Required | Identifier for the product being ordered |
productName | string | Optional | Name of the product at the time of order |
quantity | integer | Required | Number of units of the product ordered |
unitPrice | decimal | Required | Price per unit of the product at the time of order |
totalPrice | decimal | Required | Total price for this item line (quantity * unitPrice) |
Relationships
- Order: Each
OrderItem
belongs to exactly oneOrder
(identified byorderId
). It is a constituent part of the Order aggregate. - Product: Each
OrderItem
refers to oneProduct
(identified byproductId
).
Examples
- OrderItem A (for Order #12345): Product ID: P001, Quantity: 2, Unit Price: $50.00, Total Price: $100.00
- OrderItem B (for Order #12345): Product ID: P002, Quantity: 1, Unit Price: $75.00, Total Price: $75.00