cala
def checkout(order: Order): Order = {
  require(order.status == "Draft", "Invalid status")
  require(order.basket.nonEmpty  , "Basket is empty")

  order.copy(status = "Checkout")
}
```


```scala
checkout(Order(id = 34, status = "Submitted", basket = Nil))
// java.lang.IllegalArgumentException: requirement failed: Invalid status
//         at scala.Predef$.require(Predef.scala:340)
//         at project.Order.checkout(Order.scala:41)
//         at project.OrderService.checkout(OrderService.scala:125)
