Skip to content

Instantly share code, notes, and snippets.

@Raiden18
Last active May 10, 2022 14:28
Show Gist options
  • Save Raiden18/49f0ee8268fba59a47977272543d1cc9 to your computer and use it in GitHub Desktop.
Save Raiden18/49f0ee8268fba59a47977272543d1cc9 to your computer and use it in GitHub Desktop.
InformationExpert. Interactor with method
class CartInteractor(
private val cartRepository: CartRepository
) {
fun getCart() : Cart {
return cartRepository.getCart()
}
fun getApproximatePriceOfProducts(cart: Cart): BigDecimal {
return cart.products.sumOf{ it.price }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment