package com.ttstd.signaling.repository;

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

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

@Repository
public interface DeviceBindingRepository extends JpaRepository<DeviceBinding, String> {

    List<DeviceBinding> findByDeviceUid(String deviceUid);

    List<DeviceBinding> findByUserId(String userId);

    Optional<DeviceBinding> findByDeviceUidAndUserId(String deviceUid, String userId);

    List<DeviceBinding> findByDeviceUidAndStatus(String deviceUid, DeviceBinding.BindingStatus status);
}
