package de.krisenvorrat.app.domain.repository

import de.krisenvorrat.app.data.db.entity.ItemEntity
import kotlinx.coroutines.flow.Flow

internal interface ItemRepository {
    fun getAll(): Flow<List<ItemEntity>>
    suspend fun getById(id: String): ItemEntity?
    suspend fun insert(item: ItemEntity)
    suspend fun update(item: ItemEntity)
    suspend fun delete(item: ItemEntity)
    fun getByCategory(categoryId: Int): Flow<List<ItemEntity>>
    fun getByLocation(locationId: Int): Flow<List<ItemEntity>>
    fun getExpiringSoon(daysUntil: Int = 30): Flow<List<ItemEntity>>
    suspend fun countByCategoryId(categoryId: Int): Int
    suspend fun reassignCategory(fromId: Int, toId: Int)
    suspend fun countByLocationId(locationId: Int): Int
    suspend fun reassignLocation(fromId: Int, toId: Int)
    suspend fun getLastUsedLocationId(): Int?
}
