Refactor allocation strategy#6023
Open
jmiranda wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## front-counter-path-b #6023 +/- ##
==========================================================
+ Coverage 10.41% 10.65% +0.24%
- Complexity 1702 1762 +60
==========================================================
Files 923 927 +4
Lines 52229 52268 +39
Branches 12365 12370 +5
==========================================================
+ Hits 5439 5571 +132
+ Misses 45921 45787 -134
- Partials 869 910 +41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…otation + negative inventory Keeps the existing handler/resolver structure; changes only what would otherwise harden into a corner once data/messages exist. Source axis naming (persisted + message contract): - Rename enum AllocationStrategy -> AllocationSourceStrategy (it models the source axis, and "allocation strategy" collides with the supply-commitment sense used by NetSuite/Infor). Leaves room for a future ReplenishmentSourceStrategy. - Values STORAGE_FIRST / DISPLAY_FIRST / STORAGE_ONLY (drop FEFO, which is rotation not source; rename WAREHOUSE_* to STORAGE_* to match ActivityCode vocabulary). - Rename handler trio + Warehouse*Handler -> Storage*Handler and the two call sites. - Requisition field allocationStrategy -> allocationSourceStrategy; column allocation_source_strategy (renamed in the not-yet-released migration). Rotation as a separate axis, config-driven, not on the requisition: - Add RotationRule identifier (NONE/FEFO/FIFO/LIFO) and apply it after the source ordering as a stable within-bin sort: ORDER BY <rotation>, <source bin priority>. NONE leaves source order intact; FEFO reuses one shared comparator (AvailableItemComparators, dedup target for sortAvailableItems). FIFO/LIFO are declared extension points that currently fall back to source order. - Config: openboxes.order.allocation.source (default STORAGE_FIRST) and .rotation (default FEFO) replace the old .strategies list. resolveStrategies now always yields at least the configured source (no empty-strategies "Available: 0" throw). - A comment at the seam marks where a RotationStrategy + resolver will go. Remove allowNegativeInventory from the requisition (field, migration changeSet, DTO plumbing): negative-inventory is a facility/location capability resolved from activity codes at issuance time, not a per-order attribute. To be modeled by the issuance consumer; the canonical message treats it as reserved. Deferred to a follow-up ticket: rotation strategy pattern + FIFO/LIFO, per facility/product rotation cascade, InventoryLevel.sortOrder bin ordering, configurable source/rotation precedence, fill/best-available, provenance. Not executed here: Gradle/Grails deps are blocked by the environment proxy; verified by manual trace. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01DG7d6mvv9EgyvspK166v4T
jmiranda
force-pushed
the
claude/review-pr-6014-19s0ss
branch
from
July 16, 2026 05:33
6129e5f to
d584de8
Compare
druchniewicz
force-pushed
the
front-counter-path-b
branch
from
July 17, 2026 13:38
60ca612 to
bb294e7
Compare
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.
The flat AllocationStrategy enum conflated two independent concerns: which bins are eligible and in what zone order (WAREHOUSE_FIRST / DISPLAY_FIRST / WAREHOUSE_ONLY) versus which lot to take first (FEFO). As siblings in one enum they could not be combined, so "display first, FEFO within each zone" was inexpressible, and a caller could set the strategy to FEFO and silently get no zone ordering at all.
Split the two axes and compose them:
This removes the handler/abstract/resolver machinery (7 files) in favour of two enums plus a shared comparator holder, and defines the FEFO sort once in AvailableItemComparators instead of duplicating it.
Also:
Claude-Session: https://claude.ai/code/session_01DG7d6mvv9EgyvspK166v4T
✨ Description of Change
Link to GitHub issue or Jira ticket:
Description:
📷 Screenshots & Recordings (optional)