refactor: replace InventoryType alias with Inventory class#71
Merged
JacksonFergusonDev merged 6 commits intomainfrom Feb 17, 2026
Merged
refactor: replace InventoryType alias with Inventory class#71JacksonFergusonDev merged 6 commits intomainfrom
JacksonFergusonDev merged 6 commits intomainfrom
Conversation
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.
Summary
This PR completes the architectural transition for the inventory data structure. It removes the legacy
InventoryTypetype alias (which was temporarily pointing toInventoryfor backward compatibility) and refactors all dependent modules to explicitly use theInventoryclass.Changes
src/bom_lib/types.py: Removed theInventoryType = Inventoryalias.src/bom_lib/__init__.py: RemovedInventoryTypefrom the package exports.src/bom_lib/manager.py: Updated type hints incalculate_net_needs,sort_inventory, and serialization logic.src/bom_lib/parser.py: Updated signatures foringest_bom_lineand all parsing strategies (CSV, PDF, Text) to returnInventory.src/bom_lib/loader.py: Updatedprocess_input_dataand internal PDF handlers.src/bom_lib/sourcing.py: Updated hardware injection and warning generation signatures.test_parser.pyandtest_app.pyto useInventoryin type casting and mock initialization.verification
InventoryTyperemain in the codebase.pytest src/bom_lib/test_parser.pyto ensure parsing logic remains stable.pytest src/bom_lib/test_app.pyto verify the UI state injection still functions correctly with the strict class definition.