TakeawayOrder
data class TakeawayOrder(val id: OrderId, val restaurantId: RestaurantId, val customerId: CustomerId, val status: OrderStatus, val items: List<OrderItem>, val takeawayInfo: TakeawayInfo) : Order
Represents a takeaway order in the system.
Constructors
Link copied to clipboard
constructor(id: OrderId, restaurantId: RestaurantId, customerId: CustomerId, status: OrderStatus, items: List<OrderItem>, takeawayInfo: TakeawayInfo)
Properties
Link copied to clipboard
The unique identifier of the customer who placed the order.
Link copied to clipboard
The unique identifier of the restaurant associated with the order.
Link copied to clipboard
The current status of the order.
Link copied to clipboard
The takeaway information associated with the order.
Functions
Link copied to clipboard
Cancels the order if it is in a cancellable state.
Link copied to clipboard
Advances the status of the order to the next logical state.
Link copied to clipboard
Converts an Order domain model to an OrderDocument for persistence.
Link copied to clipboard
Updates the takeaway information of the order.
Link copied to clipboard
Updates the items in the order after validating them.