Skip to content

OBPIH-7195 fix3: inventory import, fix existing transaction check#5298

Merged
awalkowiak merged 2 commits intodevelopfrom
bug/OBPIH-7195-3
Jun 4, 2025
Merged

OBPIH-7195 fix3: inventory import, fix existing transaction check#5298
awalkowiak merged 2 commits intodevelopfrom
bug/OBPIH-7195-3

Conversation

@ewaterman
Copy link
Member

✨ Description of Change

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

Description: This is just embarassing now 🙃 The original code that checked for duplicate transactions was using the items in product availability, but those available items were from the time of the baseline transaction. If there were items in the import that didn't have any availability at the time of the baseline (ie quantity == 0) they didn't have any product availability records, and so wouldn't get checked. Now I make sure to check ALL items that were given in the input data.


📷 Screenshots & Recordings (optional)

Screenshot from 2025-06-02 10-39-44

@ewaterman ewaterman requested a review from awalkowiak June 2, 2025 17:56
@ewaterman ewaterman self-assigned this Jun 2, 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 Jun 2, 2025
@ewaterman ewaterman changed the title inventory import, fix existing transaction check OBPIH-7195 fix3: inventory import, fix existing transaction check Jun 2, 2025
@codecov
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.30%. Comparing base (a15b5a9) to head (d080fef).
⚠️ Report is 105 commits behind head on develop.

Files with missing lines Patch % Lines
...rehouse/importer/InventoryImportDataService.groovy 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5298      +/-   ##
============================================
- Coverage       8.34%   8.30%   -0.04%     
+ Complexity      1002     994       -8     
============================================
  Files            649     649              
  Lines          43650   43650              
  Branches       10579   10578       -1     
============================================
- Hits            3642    3625      -17     
- Misses         39446   39465      +19     
+ Partials         562     560       -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.

* ordered by transaction date to make it easy to iterate through them chronologically.
*/
List<TransactionEntry> getTransactionEntriesBeforeDate(Location facility, List<Product> products, Date date) {
List<TransactionEntry> getTransactionEntriesBeforeDate(Location facility, Collection<Product> products, Date date) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you change types from Lists to Collections?

Copy link
Member Author

Choose a reason for hiding this comment

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

I initially implemented this ticket differently and was using sets and didn't want to have to convert to lists because these methods are generic enough to handle any collection type. I changed my implementation to not need the change, but I kept this part because I felt being generic was friendlier (ex: line 146 in InventoryImportDataService)

@awalkowiak awalkowiak merged commit d060fb7 into develop Jun 4, 2025
8 checks passed
@awalkowiak awalkowiak deleted the bug/OBPIH-7195-3 branch June 4, 2025 08:47
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