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.Appointment;
import java.util.List;

@Dao
public interface AppointmentDao {
    @Insert
    void insert(Appointment appointment);

    @Query("SELECT * FROM appointments WHERE isPast = 0 ORDER BY date ASC, time ASC")
    LiveData<List<Appointment>> getFutureAppointments();

    @Query("SELECT * FROM appointments WHERE isPast = 1 ORDER BY date DESC, time DESC")
    LiveData<List<Appointment>> getPastAppointments();

    @Query("SELECT time FROM appointments WHERE date = :date")
    List<String> getBookedTimesForDate(String date);
}
