package ru.soune.nocopy.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import ru.soune.nocopy.entity.user.ProtectedFileCheck;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

@Repository
public interface ProtectedFileCheckRepository extends JpaRepository<ProtectedFileCheck, Long> {

    Optional<ProtectedFileCheck> findByUser_Id(Long userId);

    ProtectedFileCheck findByUserId(Long userId);

    boolean existsByUser_Id(Long userId);

    List<ProtectedFileCheck> findByPeriodStartDateBefore(LocalDate thirtyDaysAgo);
}