This file contains hidden or 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
class CartViewModel( | |
private val cartInteractor: CartInteractor | |
): ViewModel() { | |
private val approximatePriceOfProductsLiveData = MutableLiveData<String>() | |
init { | |
val cart = cartInteractor.getCart() | |
val approximatePriceOfProducts : BigDecimal = TODO("Must be calculated") | |
val approximatePriceOfProductsLiveData = approximatePriceOfProducts.toString() |
This file contains hidden or 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
class CartInteractor( | |
private val cartRepository: CartRepository | |
) { | |
fun getCart() : Cart { | |
return cartRepository.getCart() | |
} | |
} |
This file contains hidden or 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
data class Cart( | |
val products: List<Product> | |
) |
NewerOlder