feat(silo): assembly link extraction and BOM sync hook in Silo_Commit #73
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 1a — Assembly Link Extraction + Silo_Commit Hook
Ref:
docs/BOM_MERGE.mdPhase 1, issue #68Summary
Add a
bom_syncmodule to the silo workbench that walks an Assembly container, extracts cross-documentApp::Linkobjects, counts quantities (individual links +ElementCountarrays), and resolves each linked document'sSiloItemIdto a part number via the Silo API.Hook this into
Silo_Commit.Activated()(silo_commands.py) as a post-commit step — after the_client._upload_file()call succeeds.Requirements
New module:
mods/silo/freecad/bom_sync.pyextract_bom_links(assembly_obj, level=1)— recursively walkassembly_obj.Group, collect cross-docApp::Linkobjects, skip in-document links (linked.Document == assembly_obj.Document)_link_count(link_obj)— returnElementCountif > 0, else 1BomEntrydataclass:doc_path,silo_uuid,part_number,name,quantity,level,children,consolidation_warningresolve_part_numbers(entries, client)— resolveSiloItemIdto part number via API, return(resolved, unresolved)tupleHook in
Silo_Commit.Activated():_client._upload_file(), check ifdoccontains an Assembly objectextract_bom_links()andresolve_part_numbers()UUID property name:
SiloItemId(notSiloUUID— seeset_silo_properties()insilo_commands.py)API client: Use the existing global
_client(SiloClientinstance)API Dependency
Requires
GET /api/items/by-uuid/{uuid}or equivalent on the server (separate server-side issue).Out of Scope
Implemented in
mods/silo/freecad/bom_sync.pyas part of #276.extract_bom_entries()handles assembly link extraction and BOM sync is hooked into the upload flow.