Skip to content

bug: skip expired lots in replenishment autopick - #10

Open
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/task-39-replenishment-skip-expired-lots
Open

devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/task-39-replenishment-skip-expired-lots

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

✨ Description of Change

Link to GitHub issue or Jira ticket: Follow-up to #9 (outbound autopick skips expired lots), raised in its review.

Description:

Replenishment autopick has its own copy of the suggestion logic, PicklistService.getSuggestedItems, and that copy had no expiry check. If a depot held an expired lot with an earlier expiry date, FEFO order put it first, so a replenishment suggested and picked the expired lot.

  • PicklistService.getSuggestedItems now drops expired lots from the set autopick can choose from. Only replenishment calls it (ReplenishmentService suggested items and PicklistService.createPicklist), so no other flow changes.
  • getAvailableItems still returns expired lots, so people can still see and pick them by hand.
  • Shortfall behavior is unchanged: if unexpired stock alone can't cover the quantity, autopick suggests nothing and the user picks by hand. Autopick never fills the gap with expired stock.
  • Adds AvailableItem.isExpired(). A lot expiring today counts as expired, which matches InventoryItem.expirationStatus. The method is line-for-line the same as the one bug: outbound autopick skips expired lots #9 adds, so the two PRs merge cleanly in either order (checked locally).

Tests: the new PicklistServiceAutopickSpec has 4 cases:

  • an expired lot is skipped when an unexpired lot is in stock
  • expired stock never makes up a shortfall
  • nothing is suggested when only expired stock is left
  • a lot expiring today is skipped, while later and undated lots are still picked in FEFO order

All 4 pass on JDK 8. All 4 fail when the PicklistService change is reverted.

Frontend CI on develop still pins Node 14 / npm 6. If that check fails before it runs anything, the cause is the pin, not this change.

Devin-Org: engineering


Migration Engineer opened this PR for Matthew
Implemented in session Skip expired lots in openboxes replenishment autopick
Review with Devin · Open in Devin Desktop


@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Custom reviewers

  • 🧪 Test 2 reviewer: no findings · View
  • 🚩 TD Enterprise Architecture: no findings · View
  • 👁️ TD Information Security: no findings · View
  • 🧠 TD French Language (Bill 96): no findings · View
  • ⏱️ TD API Contracts: no findings · View

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Author

Browser check of this branch: replenishment on Main Warehouse demo data, run in a local copy of the demo database. Two fixtures were added only there: lot WALK50117 and bin min/max levels.

  • CM871, qty 20: autopick took unexpired WALK50117 and skipped expired 4041283. Replenishment R-322XKE completed.
  • Expired lots could still be selected and saved by hand.
  • TZ835, which has only expired stock: no autopick (Qty Picked 0).
  • Shortfall: 130 requested with 80 unexpired and 7,296 expired units in stock. No autopick (Qty Picked 0).
Autopick takes the unexpired lot Shortfall: no autopick
Mixed-lot replenishment Shortfall

Recording

Not checked in the browser: a develop before/after comparison and the expires-today and undated lot cases. The unit cases cover those two lot cases.

Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants