5667 add more robust inventory tracking approach - #5696
Open
armahillo wants to merge 3 commits into
Open
Conversation
The basic concept here is: "quantity" -- same current concept. Available, on-hand inventory that can be used for distributions. "committed" -- inventory that has been earmarked for distribution "physical" -- sum of "quantity" + "committed" The action concepts are: commit -> reduce quantity (available), increase committed, physical is unchanged fulfill -> quantity unchanged, decrease committed, decrease physical uncommit -> increase quantity, decrease committed, physical unchanged. These conceptual nouns and verbs cleanly describe the relationship here, and will be used for the model going forward.
NOUNS Inventory - pesistent concept, inventory that is on-hand and available for distribution Reserved - inventory that has been allocated for a scheduled Distribution Physical - the sum of inventory + reserved, inventory that is still physically on-site and countable TRANSITIONS available reserved physical created -n +n n/c edited +/- delta -/+ delta n/c completed n/c -n -n reclaimed +n -n unchanged changed after +/- delta n/c +/- delta This commit _specifically_ only does happy path with this feature. There is an obvious error state that can happen when there is nothing reserved and an existing distribution attempts to be completed (no reserved inventory to reduce). Addressing separately. Claude was used for this generation, with heavy supervision and interaction. Brock also reviewed it with me.
Ref #5667 This pass adds a feature flag and hides the reserving behavior behind it. The tests validate this. The actual behaviors around reserving inventory are now working and modifying the in-flight distributions. The inventory_aggregate spec is probably the most illustrative of the big picture, but the individual event item specs show reasonable unit test coverage of the behaviors as well. There might be some additional cleanup on the inventory_aggregator spec, but AFAIK they all pass. I ran out of time :( 🤖 Claude was used for _some_ of the code implementation on this, and while it did generate some specs initially, I rewrote most of them by hand.
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.
Ref #5667 This gets the feature most of hte way there. You'll want to read through this in detail. The individual commit messages handle more detail.
Checklist:
-->
Resolves #1
Description
Type of change
How Has This Been Tested?
Screenshots