Skip to content

OBPIH-7041: prepend zone to bin location in CC tables#5236

Merged
ewaterman merged 7 commits intodevelopfrom
ft/OBPIH-7041-cc-add-zone-to-bin
May 8, 2025
Merged

OBPIH-7041: prepend zone to bin location in CC tables#5236
ewaterman merged 7 commits intodevelopfrom
ft/OBPIH-7041-cc-add-zone-to-bin

Conversation

@ewaterman
Copy link
Member

@ewaterman ewaterman commented Apr 26, 2025

✨ Description of Change

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

Description: Prepend zone to bin location name in all cycle count table:

  • All products, to count, and to recount tabs
  • count and recount steps
  • count and recount confirmation pages

📷 Screenshots & Recordings (optional)

Bins now have zone (ex: "Container 1") prepended to their display name:
Screenshot from 2025-04-25 09-32-54

And on the count step as well:
image

@ewaterman ewaterman self-assigned this Apr 26, 2025
@ewaterman ewaterman added the status: work in progress For issues or pull requests that are in progress but not yet completed label Apr 26, 2025
@github-actions github-actions bot added type: feature A new piece of functionality for the app domain: frontend Changes or discussions relating to the frontend UI domain: backend Changes or discussions relating to the backend server flag: schema change Hilights a pull request that contains a change to the database schema labels Apr 26, 2025
@codecov
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 8.31%. Comparing base (3dbb48a) to head (0397d31).
⚠️ Report is 145 commits behind head on develop.

Files with missing lines Patch % Lines
.../org/pih/warehouse/inventory/CycleCountItem.groovy 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5236      +/-   ##
============================================
+ Coverage       8.27%   8.31%   +0.04%     
- Complexity       963     988      +25     
============================================
  Files            638     638              
  Lines          43246   43246              
  Branches       10511   10511              
============================================
+ Hits            3579    3597      +18     
+ Misses         39116   39096      -20     
- Partials         551     553       +2     

☔ 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 +29 to +31
JOIN location facility ON pa.location_id = facility.id
LEFT OUTER JOIN location bin_location ON pa.bin_location_id = bin_location.id
LEFT OUTER JOIN location zone ON bin_location.zone_id = zone.id
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you checked the performance with/without your changes? There are a lot of new joins, so I am curious how it looks right now 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

it's hard for me to test on my local since the performace is all over the place. It doesn't seem to be significantly slower than it was before but it was already really quite slow so I hope the task for materializing the views will help with that

@ewaterman ewaterman removed the status: work in progress For issues or pull requests that are in progress but not yet completed label May 6, 2025
@ewaterman ewaterman requested a review from awalkowiak May 6, 2025 18:21
product: product,
inventoryItem: inventoryItem,
binLocation: location?.toBaseJson(),
binLocation: location?.toJson(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be better to add zone name and zone id to the toBaseJson() instead using toJson, because it checks some activity codes, etc, which might degrade performance in huge cycle counts.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a fair point. I didn't want to add it to the base json because I didn't want to require the other users of that method to also pull in the zone location and degrade their performance.

I see we have this, which only adds zone information if the location type is a bin, so I think this is a good option:

binLocation: Location.toJson(location)

Side note, to me this indicates we need different location DTOs for different use cases. Or let CycleCountItem write its own toJson for bin location. The Location domain shouldn't need to hold all these different feature-specific toJson methods.

Copy link
Collaborator

@kchelstowski kchelstowski left a comment

Choose a reason for hiding this comment

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

Performance would be my only concern, so if it's fine, then I'm fine with the PR.
Remember though to use === comparison in JS.

@ewaterman ewaterman merged commit 0dd1c85 into develop May 8, 2025
9 checks passed
@ewaterman ewaterman deleted the ft/OBPIH-7041-cc-add-zone-to-bin branch May 8, 2025 16:05
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 domain: frontend Changes or discussions relating to the frontend UI flag: schema change Hilights a pull request that contains a change to the database schema type: feature A new piece of functionality for the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants