package com.gestoreasy.repository

import com.gestoreasy.database.dao.GoalDao
import com.gestoreasy.database.entities.Goal
import kotlinx.coroutines.flow.Flow

class GoalRepository(private val goalDao: GoalDao) {
    suspend fun insertOrUpdate(goal: Goal) {
        goalDao.insertOrUpdate(goal)
    }
    
    suspend fun getAll(): List<Goal> {
        return goalDao.getAll()
    }
    
    suspend fun getActive(): List<Goal> {
        return goalDao.getActive()
    }
    
    suspend fun getByType(tipo: String): List<Goal> {
        return goalDao.getByType(tipo)
    }
    
    fun getAllFlow(): Flow<List<Goal>> {
        return goalDao.getAllFlow()
    }
}

