package de.oaa.xxx.feed.repository;

import de.oaa.xxx.feed.entity.FeedPostLikeEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

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

public interface FeedPostLikeRepository extends JpaRepository<FeedPostLikeEntity, UUID> {

    Optional<FeedPostLikeEntity> findByPostIdAndUserId(UUID postId, UUID userId);

    long countByPostId(UUID postId);

    @Transactional
    void deleteByPostId(UUID postId);
}
