Interface ReactionRepositoryAdapter

All Known Implementing Classes:
ReactionRepositoryAdapterImpl

public interface ReactionRepositoryAdapter
Adapter for reaction repository operations with exception handling.
  • Method Details

    • save

      ReactionEntity save(ReactionEntity reactionEntity)
      Saves a reaction entity to the database with exception translation. Detects unique constraint violations for duplicate reactions.
      Parameters:
      reactionEntity - the reaction entity to save
      Returns:
      the saved reaction entity with generated ID
      Throws:
      FailedToSaveReactionException - if the save operation fails
      UserHasAlreadyReactedException - if user already has a reaction on this post
    • findByPostIdAndUserId

      ReactionEntity findByPostIdAndUserId(Long postId, Long userId)
      Finds a reaction by post ID and user ID with exception translation.
      Parameters:
      postId - the ID of the post
      userId - the ID of the user
      Returns:
      the reaction entity if found
      Throws:
      ReactionNotFoundException - if the reaction does not exist
      FailedToFindReactionException - if the find operation fails