Interface ReactionRepositoryAdapter
- All Known Implementing Classes:
ReactionRepositoryAdapterImpl
public interface ReactionRepositoryAdapter
Adapter for reaction repository operations with exception handling.
-
Method Summary
Modifier and TypeMethodDescriptionfindByPostIdAndUserId(Long postId, Long userId) Finds a reaction by post ID and user ID with exception translation.save(ReactionEntity reactionEntity) Saves a reaction entity to the database with exception translation.
-
Method Details
-
save
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 failsUserHasAlreadyReactedException- if user already has a reaction on this post
-
findByPostIdAndUserId
Finds a reaction by post ID and user ID with exception translation.- Parameters:
postId- the ID of the postuserId- the ID of the user- Returns:
- the reaction entity if found
- Throws:
ReactionNotFoundException- if the reaction does not existFailedToFindReactionException- if the find operation fails
-