AddBasketItem

@Summary(value = "Add an item to the basket")
data class AddBasketItem(val productId: String, val unitPrice: BigDecimal, val quantity: Int)

Adds quantity of productId at unitPrice to the basket, creating the basket on its first item. Adding a product already in the basket adds to its quantity, at the new price. The constraints are the command's shape: the gateway checks them before the basket decides, and answers a violation wow.command.invalid (400).

Constructors

Link copied to clipboard
constructor(productId: String, unitPrice: BigDecimal, quantity: Int)

Properties

Link copied to clipboard
Link copied to clipboard
@Positive
val quantity: Int
Link copied to clipboard
@PositiveOrZero
val unitPrice: BigDecimal