Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make capture mode return enrollments in capture scope [TECH-1635] #15518

Merged
merged 5 commits into from
Oct 30, 2023

Conversation

muilpp
Copy link
Contributor

@muilpp muilpp commented Oct 27, 2023

Capture mode in /enrollments returns enrollments in search scope, which should not happen.
With this fix, we return only enrollments in the user capture scope.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #15518 (d56de1b) into master (6f97d60) will increase coverage by 0.02%.
Report is 1 commits behind head on master.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##             master   #15518      +/-   ##
============================================
+ Coverage     66.21%   66.23%   +0.02%     
- Complexity    31216    31246      +30     
============================================
  Files          3485     3485              
  Lines        129739   129766      +27     
  Branches      15134    15142       +8     
============================================
+ Hits          85905    85952      +47     
+ Misses        36749    36735      -14     
+ Partials       7085     7079       -6     
Flag Coverage Δ
integration 49.77% <50.00%> (+<0.01%) ⬆️
integration-h2 32.39% <0.00%> (-0.01%) ⬇️
unit 30.35% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rg/hisp/dhis/program/DefaultEnrollmentService.java 53.20% <62.50%> (+1.52%) ⬆️
...er/export/enrollment/DefaultEnrollmentService.java 61.25% <33.33%> (-1.09%) ⬇️

... and 25 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f97d60...d56de1b. Read the comment docs.

@@ -204,6 +206,9 @@ public List<Enrollment> getEnrollments(EnrollmentOperationParams params)
&& queryParams.isOrganisationUnitMode(OrganisationUnitSelectionMode.ACCESSIBLE)) {
queryParams.setOrganisationUnits(user.getTeiSearchOrganisationUnitsWithFallback());
queryParams.setOrganisationUnitMode(OrganisationUnitSelectionMode.DESCENDANTS);
} else if (user != null && queryParams.isOrganisationUnitMode(CAPTURE)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should apply the same fix to the next method that gets a Page of enrollments

@muilpp muilpp marked this pull request as ready for review October 27, 2023 13:48
@muilpp muilpp requested review from enricocolasante and a team October 27, 2023 13:48
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
11.4% 11.4% Duplication

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.

2 participants