Skip to main content

where_used_levels

Function where_used_levels 

Source
pub async fn where_used_levels(
    pool: &PgPool,
    actor: &Actor,
    item_id: Uuid,
    levels: i32,
) -> AppResult<Vec<WhereUsedLevel>>
Expand description

Multi-level where-used: every BOM line that uses the item or (up to levels levels up) one of its parents. Like the single-level report it looks at the BOMs of all revisions. Each item is reported on the lowest level it is reached on: the walk goes up one level per query (the parents not seen before form the next level), so a part used in thousands of assemblies costs one query per level instead of a recursive expansion of every path. The report stops at MAX_WHERE_USED_ROWS rows.