Skip to content

refactor: replace InventoryType alias with Inventory class#71

Merged
JacksonFergusonDev merged 6 commits intomainfrom
refactor/inventorytype
Feb 17, 2026
Merged

refactor: replace InventoryType alias with Inventory class#71
JacksonFergusonDev merged 6 commits intomainfrom
refactor/inventorytype

Conversation

@JacksonFergusonDev
Copy link
Copy Markdown
Owner

Summary

This PR completes the architectural transition for the inventory data structure. It removes the legacy InventoryType type alias (which was temporarily pointing to Inventory for backward compatibility) and refactors all dependent modules to explicitly use the Inventory class.

Changes

  • src/bom_lib/types.py: Removed the InventoryType = Inventory alias.
  • src/bom_lib/__init__.py: Removed InventoryType from the package exports.
  • src/bom_lib/manager.py: Updated type hints in calculate_net_needs, sort_inventory, and serialization logic.
  • src/bom_lib/parser.py: Updated signatures for ingest_bom_line and all parsing strategies (CSV, PDF, Text) to return Inventory.
  • src/bom_lib/loader.py: Updated process_input_data and internal PDF handlers.
  • src/bom_lib/sourcing.py: Updated hardware injection and warning generation signatures.
  • Tests: Updated test_parser.py and test_app.py to use Inventory in type casting and mock initialization.

verification

  • Static Analysis: Checked that no references to InventoryType remain in the codebase.
  • Unit Tests: Ran pytest src/bom_lib/test_parser.py to ensure parsing logic remains stable.
  • Integration Tests: Ran pytest src/bom_lib/test_app.py to verify the UI state injection still functions correctly with the strict class definition.

@JacksonFergusonDev JacksonFergusonDev merged commit 09ad790 into main Feb 17, 2026
1 check passed
@JacksonFergusonDev JacksonFergusonDev deleted the refactor/inventorytype branch February 17, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant