Skip to content

OBPIH-7542 Fix do not subtract expired stock filter causing 500 error#5605

Merged
kchelstowski merged 1 commit intodevelopfrom
bug/OBPIH-7542
Nov 7, 2025
Merged

OBPIH-7542 Fix do not subtract expired stock filter causing 500 error#5605
kchelstowski merged 1 commit intodevelopfrom
bug/OBPIH-7542

Conversation

@kchelstowski
Copy link
Collaborator

✨ Description of Change

Link to GitHub issue or Jira ticket:

Description:


📷 Screenshots & Recordings (optional)

@kchelstowski kchelstowski self-assigned this Nov 6, 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 Nov 6, 2025
boolean removeExpiredStock = expirationFilter == ExpirationFilter.SUBTRACT_EXPIRED_STOCK
Date today = new Date()
Date maxDate = removeExpiredStock ? today : today + expirationFilter.days
Date maxDate = removeExpiredStock ? today : today + (expirationFilter.days ?: 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ewaterman I take it back, as you caught it in the previous PR. I forgot I moved this part of the code outside the .sum closures, and I tested it probably when having it yet inside, hence it was breaking for DO_NOT_SUBTRACT_EXPIRED_STOCK.

Copy link
Member

Choose a reason for hiding this comment

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

👍 I'll approve this as is, but an alternative solution would be to set a days value of 0 in the ExpirationFilter for INCLUDE_EXPIRED_STOCK and REMOVE_EXPIRED_STOCK. I haven't thought through the implications of doing that, so I leave it to you to decide which approach you prefer.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 8.49%. Comparing base (1bb7314) to head (384ffe4).
⚠️ Report is 181 commits behind head on develop.

Files with missing lines Patch % Lines
...ehouse/inventory/ProductAvailabilityService.groovy 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5605      +/-   ##
============================================
- Coverage       9.12%   8.49%   -0.64%     
+ Complexity      1170    1116      -54     
============================================
  Files            701     712      +11     
  Lines          45281   45598     +317     
  Branches       10851   10913      +62     
============================================
- Hits            4131    3872     -259     
- Misses         40497   41152     +655     
+ Partials         653     574      -79     

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

@kchelstowski kchelstowski merged commit 49d1a38 into develop Nov 7, 2025
7 checks passed
@kchelstowski kchelstowski deleted the bug/OBPIH-7542 branch November 7, 2025 08:58
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