package com.honey.honey.repository;

import com.honey.honey.model.NotificationAudit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface NotificationAuditRepository extends JpaRepository<NotificationAudit, Long> {

    /** Latest audit row for the user (by created_at). Uses index (user_id, created_at DESC). */
    Optional<NotificationAudit> findTopByUserIdOrderByCreatedAtDesc(Integer userId);
}
