$.`require(Predef.scala:340)`
//         at project.Order.checkout(Order.scala:41)
//         at project.OrderService.checkout(OrderService.scala:125)
//         at project.OrderAPI.service(OrderAPI.scala:78)
//         ...
```
]

---
# Solution 1: Exception stack trace

<br>

.eighty-two-left[
```scala
def checkout(order: Order): Order = {
  require(order.status == "Draft", "Invalid status")
  require(order.basket.nonEmpty  , "Basket is empty")

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


```scala
checkout(O