Order

sealed class Order : Entity<OrderId>

Represents an order in the system, which can be of different types (Delivery, Takeaway, DineIn).

Inheritors

Types

Link copied to clipboard
sealed interface AdvanceStatusResult

Represents the result of attempting to advance the status of an order.

Link copied to clipboard
sealed interface CancelResult

Represents the result of attempting to cancel an order.

Link copied to clipboard
object Companion
Link copied to clipboard

Represents possible validation errors for order items.

Link copied to clipboard
sealed interface UpdateResult

Represents the result of attempting to update the items in an order.

Properties

Link copied to clipboard

The unique identifier for the customer who placed the order.

Link copied to clipboard
open override val id: OrderId

The unique identifier for the order.

Link copied to clipboard
open val items: List<OrderItem>

The list of items included in the order.

Link copied to clipboard

The unique identifier for the restaurant associated with the order.

Link copied to clipboard

The current status of the order.

Functions

Link copied to clipboard

Cancels the order if it is in a cancellable state.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
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
Link copied to clipboard

Updates the items in the order after validating them.