111 filter activities by name new activities and subscribed ones#116
Merged
JonayKB merged 2 commits intoApr 22, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds new methods to filter activities by name and paginates non‑subscribed activities across the repository, service, and controller layers.
- Introduces tests for getting subscribed activities with streaks, pagination for non‑subscribed activities, and filtering by activity name.
- Updates repository queries and service interfaces to support the new filtering and pagination functionality.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| API/src/test/java/es/iespuertodelacruz/routinefights/activity/infrastructure/adapters/secondary/service/ActivityEntityServiceTest.java | Adds tests for new service methods |
| API/src/test/java/es/iespuertodelacruz/routinefights/activity/infrastructure/adapters/primary/v2/controllers/ActivityV2ControllerTest.java | Adds tests for new controller endpoints |
| API/src/main/java/es/iespuertodelacruz/routinefights/activity/infrastructure/adapters/secondary/services/ActivityEntityService.java | Implements pagination and filtering methods |
| API/src/main/java/es/iespuertodelacruz/routinefights/activity/infrastructure/adapters/secondary/repositories/IActivityEntityRepository.java | Updates repository queries for activity filtering and pagination |
| API/src/main/java/es/iespuertodelacruz/routinefights/activity/infrastructure/adapters/primary/v2/controllers/ActivityControllerV2.java | Adds new endpoints for filtered and paginated activities |
| API/src/main/java/es/iespuertodelacruz/routinefights/activity/domain/services/ActivityService.java | Updates service layer to call new repository methods |
| API/src/main/java/es/iespuertodelacruz/routinefights/activity/domain/ports/secondary/IActivityRepository.java | Extends repository interface with new methods |
| API/src/main/java/es/iespuertodelacruz/routinefights/activity/domain/ports/primary/IActivityService.java | Extends service interface with new methods |
Files not reviewed (1)
- API/src/main/resources/graphql/schema.graphqls: Language not supported
|
|
||
| @Override | ||
| public List<Activity> getPaginationNotSubscribed(int page, int perPage, String userID, String activityName) { | ||
| int offset = (page-1) * perPage; |
There was a problem hiding this comment.
The pagination calculation subtracts 1 from 'page', which can yield a negative offset if a value of 0 is passed. Consider either validating that 'page' is at least 1 or adjusting the calculation to be consistent with zero-based page numbering.
Suggested change
| int offset = (page-1) * perPage; | |
| int offset = (Math.max(1, page) - 1) * perPage; |
JonayKB
added a commit
that referenced
this pull request
Jan 24, 2026
…w-activities-and-subscribed-ones 111 filter activities by name new activities and subscribed ones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.