package com.example.cuida.data.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import com.example.cuida.data.model.Medication;
import java.util.List;

@Dao
public interface MedicationDao {
    @Insert
    void insert(Medication medication);

    @androidx.room.Update
    void update(Medication medication);

    @Query("SELECT * FROM medications ORDER BY time ASC")
    LiveData<List<Medication>> getAllMedications();

    @Query("SELECT * FROM medications ORDER BY time ASC LIMIT 1")
    LiveData<Medication> getNextMedication();
}
