package ru.soune.nocopy.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import ru.soune.nocopy.entity.user.EmailVerificationToken;

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

public interface EmailVerificationTokenRepository extends JpaRepository<EmailVerificationToken, Long> {
    Optional<EmailVerificationToken> findByToken(String token);
    EmailVerificationToken findByUserIdAndToken(Long userId, String token);
    List<EmailVerificationToken> findByExpiresAtBefore(LocalDateTime expiresAtBefore);
    EmailVerificationToken findByUserId(Long userId);
}
