This commit is contained in:
Ismailov_Rovshan 2023-12-18 13:45:37 +04:00
parent 56b1e815c6
commit 89fee0d2c6
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,9 @@
package com.example.myapplication.database.repository
import com.example.myapplication.database.entities.Category
import kotlinx.coroutines.flow.Flow
interface CategoryRepository {
fun getAll(): Flow<List<Category>>
suspend fun insert(category: Category)
}

View File

@ -0,0 +1,4 @@
package com.example.myapplication.database.repository
interface ProductRepository {
}

View File

@ -0,0 +1,16 @@
package com.example.myapplication.database.repository
import com.example.myapplication.database.entities.User
import kotlinx.coroutines.flow.Flow
interface UserRepository {
fun getAll(): Flow<List<User>>
fun getById(id: Int): Flow<User>
fun getByAuth(login: String, password: String): Flow<User?>
fun getUserItemsCartById(id: Int): Flow<UserWithCartItems>
suspend fun deleteCartItem(userId: Int, itemId: Int)
suspend fun deleteFavoriteItem(userId: Int, itemId: Int)
suspend fun insert(user: User)
suspend fun addItemCart(userItem: UserItemCart)
}