Skip to content

Conversation

@ewaterman
Copy link
Member

@ewaterman ewaterman commented Jan 8, 2026

…me new lot

✨ Description of Change

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

Description: We were getting errors on record stock if you add two or more rows with a lot number that does not yet exist. This is because we were looping through the rows, creating the items, and since both rows were in the same transaction, they both try to create the same lot. The fix was to first collect all unique lots from all rows and then get or create them in bulk.

@ewaterman ewaterman self-assigned this Jan 8, 2026
@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 8, 2026
* This class acts like a simplified InventoryItem. We'd like to one day refactor InventoryItem to either use
* or be more like this class, but for now this class is a simple POJO.
*/
class ProductLot {
Copy link
Member Author

Choose a reason for hiding this comment

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

Hilighting this class in case there are any opinions

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 65.51724% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.83%. Comparing base (1bb7314) to head (f2b8e74).
⚠️ Report is 141 commits behind head on develop.

Files with missing lines Patch % Lines
...vy/org/pih/warehouse/product/lot/ProductLot.groovy 37.50% 3 Missing and 2 partials ⚠️
...ih/warehouse/inventory/InventoryItemManager.groovy 63.63% 3 Missing and 1 partial ⚠️
...rehouse/inventory/InventoryItemByProductLot.groovy 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5703      +/-   ##
============================================
+ Coverage       9.12%   9.83%   +0.71%     
- Complexity      1170    1375     +205     
============================================
  Files            701     731      +30     
  Lines          45281   46128     +847     
  Branches       10851   11009     +158     
============================================
+ Hits            4131    4537     +406     
- Misses         40497   40886     +389     
- Partials         653     705      +52     

☔ 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.

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.

2 participants