OrderDocument
@MappedEntity
Represents the MongoDB document for storing order information.
Since orderType is a sealed hierarchy with three subtypes, this document uses a discriminator field orderType plus mutually-exclusive optional fields to flatten the hierarchy into a single MongoDB collection.
Constructors
Link copied to clipboard
constructor(id: String, orderType: String, restaurantId: String, customerId: String, status: String, items: List<OrderItemDocument>, deliveryInfo: DeliveryInfoDocument? = null, tableInfo: TableInfoDocument? = null, takeawayInfo: TakeawayInfoDocument? = null)
Properties
Link copied to clipboard
The identifier of the customer who placed the order.
Link copied to clipboard
Populated only when orderType is DELIVERY.
Link copied to clipboard
The list of items embedded within the order.
Link copied to clipboard
The identifier of the restaurant the order belongs to.
Link copied to clipboard
Populated only when orderType is DINE_IN.
Link copied to clipboard
Populated only when orderType is TAKEAWAY.