Skip to content

123 like a post#127

Merged
JonayKB merged 3 commits into
mainfrom
123-like-a-post
Apr 25, 2025
Merged

123 like a post#127
JonayKB merged 3 commits into
mainfrom
123-like-a-post

Conversation

@JonayKB
Copy link
Copy Markdown
Owner

@JonayKB JonayKB commented Apr 25, 2025

No description provided.

@JonayKB JonayKB requested review from Copilot and rabgonzalez April 25, 2025 11:08
@JonayKB JonayKB self-assigned this Apr 25, 2025
@JonayKB JonayKB linked an issue Apr 25, 2025 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new functionality to support liking and unliking posts throughout the user-related modules. Key changes include:

  • New service methods and repository queries for likePost and unLikePost.
  • Additional tests covering both successful and exceptional cases.
  • New endpoints in the UserControllerV2 to expose the like/unlike features.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
API/src/test/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/secondary/services/UserEntityServiceTest.java Added tests for like and unlike post, including exception scenarios.
API/src/test/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/primary/v2/controllers/UserControllerV2Test.java Added tests for new controller endpoints covering like/unlike operations and exception handling.
API/src/test/java/es/iespuertodelacruz/routinefights/user/domain/services/UserServiceTest.java Added tests to verify service layer support for like/unlike operations.
API/src/main/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/secondary/services/UserEntityService.java Implemented likePost and unLikePost with exception handling.
API/src/main/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/secondary/repositories/IUserEntityRepository.java Added repository queries for likePost and unLikePost.
API/src/main/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/primary/v2/controllers/UserControllerV2.java Introduced endpoints for like and unlike post with security constraints.
API/src/main/java/es/iespuertodelacruz/routinefights/user/domain/services/UserService.java Added service methods delegating to repository for like/unlike functionality.
API/src/main/java/es/iespuertodelacruz/routinefights/user/common/IUserCommon.java Updated common interface to include like/unlike operations.
Files not reviewed (1)
  • API/src/main/resources/graphql/schema.graphqls: Language not supported
Comments suppressed due to low confidence (2)

API/src/main/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/secondary/services/UserEntityService.java:389

  • [nitpick] Consider using consistent camelCase naming (e.g. 'unlikePost' instead of 'unLikePost') across the codebase to improve readability.
public Boolean unLikePost(String userId, String postId) {

API/src/main/java/es/iespuertodelacruz/routinefights/user/infrastructure/adapters/secondary/repositories/IUserEntityRepository.java:49

  • [nitpick] Consider aligning parameter naming with lowerCamelCase (e.g. 'userId' and 'postId') to maintain consistency with the service layer.
@Query("MATCH (u: User) MATCH (p: Post) WHERE elementId(p) = $postID AND elementId(u) = $userID MERGE (u)-[:Liked]->(p) RETURN exists((u)-[:Liked]->(p))")

@JonayKB JonayKB merged commit fbe34ca into main Apr 25, 2025
3 checks passed
JonayKB added a commit that referenced this pull request Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Like a post

2 participants