package com.gnx.telemedicine.repository;

import com.gnx.telemedicine.model.TrustedDevice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

@Repository
public interface TrustedDeviceRepository extends JpaRepository<TrustedDevice, UUID> {
    
    List<TrustedDevice> findByUserIdOrderByLastSeenDesc(UUID userId);
    
    Optional<TrustedDevice> findByUserIdAndDeviceFingerprint(UUID userId, String deviceFingerprint);
    
    List<TrustedDevice> findByUserIdAndIsTrustedTrue(UUID userId);
    
    void deleteByUserIdAndDeviceFingerprint(UUID userId, String deviceFingerprint);
}

