package com.ttstd.signaling.repository;

import com.ttstd.signaling.model.DeviceBlacklistEntry;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

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

@Repository
public interface DeviceBlacklistRepository
        extends JpaRepository<DeviceBlacklistEntry, DeviceBlacklistEntry.PK> {

    List<DeviceBlacklistEntry> findByDeviceUid(String deviceUid);

    Optional<DeviceBlacklistEntry> findByDeviceUidAndBlockedUserId(String deviceUid, String blockedUserId);

    boolean existsByDeviceUidAndBlockedUserId(String deviceUid, String blockedUserId);
}
