trait DiscountStrategy {
def apply(price: Int): Int
}
def applyDiscounts(
item: Item, // case class Item(name: String, price: Int)
quantity: Int,
discount: Option[DiscountStrategy]
): (Int, Int) = {
val price = item.price * quantity
val discounted = discount.fold(price)(_.apply(price))
(price, discounted)
}