Order (v1.0.0)
Represents a customer's request to purchase products or services.
Overview
The Order entity captures all details related to a customer’s purchase request. It serves as the central aggregate root within the Orders domain, coordinating information about the customer, products ordered, payment, and shipping.
Entity Properties
Name | Type | Required | Description |
---|---|---|---|
orderId | UUID | Required | Unique identifier for the order |
orderNumber | string | Required | Unique identifier for the order |
customerId | UUID | Optional | Identifier for the customer placing the order test |
orderDate | DateTime | Required | Date and time when the order was placed |
status | string Enum:
| Required | Current status of the order (e.g., Pending, Processing, Shipped, Delivered, Cancelled) |
orderItems | array<OrderItem > | Required | List of items included in the order |
totalAmount | decimal | Required | Total monetary value of the order |
shippingAddress | Address | Required | Address where the order should be shipped |
billingAddress | Address | Required | Address for billing purposes |
payment | Payment | Optional | Payment associated with this order |
convertedFromCartId | UUID | Optional | Shopping cart that was converted to this order |
Relationships
- Customer: Each order belongs to one
Customer
(identified bycustomerId
). - OrderItem: An order contains one or more
OrderItem
entities detailing the specific products and quantities. - Address: Each order has shipping and billing
Address
entities (identified byshippingAddress
andbillingAddress
). - Payment: An order is associated with one
Payment
entity for transaction processing. - ShoppingCart: An order can be converted from a
ShoppingCart
(identified byconvertedFromCartId
). - Shipment: An order may lead to one or more
Shipment
entities (not detailed here).
Examples
- Order #12345: A customer orders 2 units of Product A and 1 unit of Product B, to be shipped to their home address. Status is ‘Processing’.
- Order #67890: A customer places a large order for multiple items, requiring special shipping arrangements. Status is ‘Pending’ until payment confirmation.