package com.syaroful.agrilinkvocpro.plant_disease_detection_feature.data.repository

import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.data.local.dao.PlantDiagnosisDao
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.data.local.entity.PlantDiagnosisEntity
import kotlinx.coroutines.flow.Flow

class PlantDiagnosisLocalRepository(
    private val dao: PlantDiagnosisDao
) {
    suspend fun saveDiagnosis(entity: PlantDiagnosisEntity) {
        dao.insertDiagnosis(entity)
    }

    fun getAllDiagnosis(): Flow<List<PlantDiagnosisEntity>> = dao.getAllDiagnosis()

    fun getDiagnosisById(id: Int): Flow<PlantDiagnosisEntity?> {
        return dao.getDiagnosisById(id)
    }
}