Skip to content

OBPIH-6936 remove duplicates from product classification list endpoint#5019

Merged
awalkowiak merged 2 commits intodevelopfrom
bug/OBPIH-6936-remove-dupes-from-product-classifications
Jan 30, 2025
Merged

OBPIH-6936 remove duplicates from product classification list endpoint#5019
awalkowiak merged 2 commits intodevelopfrom
bug/OBPIH-6936-remove-dupes-from-product-classifications

Conversation

@ewaterman
Copy link
Member

✨ Description of Change

A concise summary of what is being changed. Please provide enough context for reviewers to be able to understand the change and why it is necessary. If the issue/ticket already provides enough information, you can put "See ticket" as the description.

Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-6936

Description: Remove duplicates from the product classification list endpoint by fetching the ABC classes as a Set


📷 Screenshots & Recordings (optional)

image

@ewaterman ewaterman self-assigned this Jan 28, 2025
@github-actions github-actions bot added type: bug Addresses unintended behaviours of the app domain: backend Changes or discussions relating to the backend server labels Jan 28, 2025
@codecov
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 7.75%. Comparing base (b290f9c) to head (f1e3d32).
Report is 201 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5019      +/-   ##
============================================
- Coverage       7.75%   7.75%   -0.01%     
  Complexity       860     860              
============================================
  Files            613     613              
  Lines          42623   42621       -2     
  Branches       10350   10350              
============================================
- Hits            3306    3305       -1     
+ Misses         38823   38822       -1     
  Partials         494     494              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 62 to 65
return productClassifications.stream()
// Once ABC class becomes its own domain, this sort by name can be moved to the query.
.sorted()
.collect{ new ProductClassificationDto(name: it) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you have to use stream here? 🤔
Can't it be just:

Suggested change
return productClassifications.stream()
// Once ABC class becomes its own domain, this sort by name can be moved to the query.
.sorted()
.collect{ new ProductClassificationDto(name: it) }
return productClassifications
// Once ABC class becomes its own domain, this sort by name can be moved to the query.
.sort()
.collect{ new ProductClassificationDto(name: it) }

Copy link
Member Author

Choose a reason for hiding this comment

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

you're right. I'm still too Java-brained 😅

@awalkowiak awalkowiak merged commit 8eac977 into develop Jan 30, 2025
9 checks passed
@awalkowiak awalkowiak deleted the bug/OBPIH-6936-remove-dupes-from-product-classifications branch January 30, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server type: bug Addresses unintended behaviours of the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants