package com.weighttracker.repository;

import com.weighttracker.model.User;
import com.weighttracker.model.WeightRecord;
import org.springframework.data.jpa.repository.JpaRepository;

import java.time.LocalDateTime;
import java.util.List;

public interface WeightRecordRepository extends JpaRepository<WeightRecord, Long> {
    List<WeightRecord> findTop10ByUserOrderByDateDesc(User user);
    List<WeightRecord> findByUserOrderByDateDesc(User user);
    List<WeightRecord> findByUserAndDateAfterOrderByDateAsc(User user, LocalDateTime date);
    List<WeightRecord> findByUserAndDateBetweenOrderByDateAsc(User user, LocalDateTime start, LocalDateTime end);
    void deleteAllByUser(User user);

}
