Result

sealed interface Result

Represents the result of the place order operation. It can be either a success with the created order details or a failure with specific reasons.

  • Success: The order was successfully placed, and the details of the created order are returned.

  • Failure: The attempt to place the order failed, with specific reasons:

  • InvalidDate: The provided date for the order is invalid (e.g., in the past).

  • EmptyItems: The order does not contain any items.

  • InvalidItemQuantity: One or more items in the order have an invalid quantity.

Inheritors

Types

Link copied to clipboard
sealed interface Failure : PlaceOrder.Result
Link copied to clipboard
data class Success(val order: OrderDto) : PlaceOrder.Result