Repository navigation
bug: outbound autopick skips expired lots - #9
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
|
||
| Boolean isExpired() { | ||
| Date expirationDate = inventoryItem?.expirationDate | ||
| return expirationDate ? expirationDate.before(new Date().clearTime() + 1) : false |
Author
There was a problem hiding this comment.
🔍 Expiration-day policy differs from description
For lots expiring today, isExpired() excludes them from autopick, while the PR description promises eligibility. The updated test explicitly enforces exclusion. This matches getExpirationStatus, but leaves the stated expiration-day policy inconsistent.
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Description of Change
Link to GitHub issue or Jira ticket: Reported in the #matthew-bots browser walkthrough (Bug 1).
Description:
Outbound autopick suggested and shipped expired lots. Repro on demo data: Lamivudine 150mg, qty 5 from Main Warehouse picked lot
4041283(expired 30/Nov/2025) even though lotWALK50117(expires 2030) was in stock.StockMovementService.getAvailableItemshad no expiry check, and FEFO sorting put the expired lot first.AvailableItem.isExpired(): true when the lot's expiration date is today or earlier, matchingInventoryItem.expirationStatus. Lots with no expiry date are not expired.getAvailableItems: expired lots sort after unexpired ones. They stay in the list, so a user can still pick one by hand on the Pick page.getSuggestedItems(availableItems, quantity, skipExpired): only the autopick callers (createPicklistand the Pick page suggestions inbuildPickPageItem) passskipExpired = true. Autopick never suggests an expired lot, and it never tops up short unexpired stock from an expired lot.getSuggestedItems, which doesn't skip expired lots. A row that names an expired lot with a blank bin still gets picked from the lot's bin, as it did before this PR.Tests: new
StockMovementServiceAutopickSpec, 5 cases:Results:
inventory.*,fulfillment.*andpicklist.*unit tests: 84 tests, 0 failures.-x npmInstall -x npm_run_bundle.Out of scope: replenishment autopick uses its own
PicklistService.getSuggestedItems, which is being fixed in a separate PR.CI note:
frontend-tests.ymlandbuild.gradleondevelopstill pin Node 14 / npm 6, which has brokennpm cion other PRs. This PR touches no frontend code.Devin-Org: engineering
Implemented in session Fix worst openboxes bug with coverage
Review with Devin · Open in Devin Desktop