Validation
Overview
You can define validate
function to ensure a basket is valid, either before returning it to the client or before creating an order.
When no validation functions is provided, the basket is always considered valid.
Example
declo.config.ts
.validate(basket => {
return basket.items.length > 0 && basket.price > 0
})