Skip to content

111 filter activities by name new activities and subscribed ones#116

Merged
JonayKB merged 2 commits into
mainfrom
111-filter-activities-by-name-new-activities-and-subscribed-ones
Apr 22, 2025
Merged

111 filter activities by name new activities and subscribed ones#116
JonayKB merged 2 commits into
mainfrom
111-filter-activities-by-name-new-activities-and-subscribed-ones

Conversation

@JonayKB
Copy link
Copy Markdown
Owner

@JonayKB JonayKB commented Apr 22, 2025

No description provided.

@JonayKB JonayKB requested review from Copilot and rabgonzalez April 22, 2025 14:54
@JonayKB JonayKB self-assigned this Apr 22, 2025
@JonayKB JonayKB linked an issue Apr 22, 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 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;
Copy link

Copilot AI Apr 22, 2025

Choose a reason for hiding this comment

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

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;

Copilot uses AI. Check for mistakes.
@JonayKB JonayKB merged commit 357a292 into main Apr 22, 2025
3 checks passed
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
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.

Filter Activities by name (new activities and subscribed ones)

2 participants