package de.oaa.xxx.games.chastity.keyholder;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
import java.util.UUID;

public interface KeyholderInvitationRepository extends JpaRepository<KeyholderInvitationEntity, UUID> {
    Optional<KeyholderInvitationEntity> findByToken(String token);
    java.util.List<KeyholderInvitationEntity> findByKeyholderUserId(UUID keyholderUserId);
    java.util.List<KeyholderInvitationEntity> findByLockeeUserId(UUID lockeeUserId);
    java.util.List<KeyholderInvitationEntity> findByLockId(UUID lockId);
    @Transactional
    void deleteByLockId(UUID lockId);
    @Transactional
    void deleteByToken(String token);
}
