Created
November 30, 2018 10:27
-
-
Save ljwagerfield/40429bdecd90e2a24983c3f6294a64a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Product(id: Int, price: Int, inStock: Boolean) | |
case class Basket(productIds: List[Int]) | |
trait ProductRepo { | |
def getProduct(productId: Int): Product | |
} | |
trait ShoppingBasketRepo { | |
def getShoppingBasket(basketId: Int): Basket | |
} | |
object Application extends App { | |
val productRepo: ProductRepo = ??? // Assume this is implemented | |
val basketRepo: ShoppingBasketRepo = ??? // Assume this is implemented | |
def getBasketTotal(basketId: Int, inStockItemsOnly: Boolean): Int = { | |
??? // Todo: Implement | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment