package com.zyzf.coffeepreorder.database.repository

import androidx.paging.PagingData
import com.zyzf.coffeepreorder.database.model.Cart
import com.zyzf.coffeepreorder.database.model.Coffee
import kotlinx.coroutines.flow.Flow

interface CartRepository {
    suspend fun getAll(): Cart
    suspend fun insert(cart: Cart)
    fun getAllInCart(): Flow<PagingData<Coffee>>
    fun getSumInCart(): Double
    suspend fun insertCoffee(coffeeId: Int, count: Int)
    suspend fun deleteCoffee(coffeeId: Int, count: Int)
    fun getCountForCoffee(coffeeId: Int): Double
    suspend fun update(cart: Cart)
    suspend fun deleteAll()
}
