# BillOfMaterialLine

## Description

BillOfMaterialLine stores one component entry within a BillOfMaterial version. It owns the component item reference, required quantity, unit of measure, scrap assumption, and subassembly flag that drive BOM explosion and production-order material requirements at release time.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [createBillOfMaterial](../commands/CreateBillOfMaterial.md) - Create draft BOM versions including initial component lines.
- [updateBillOfMaterial](../commands/UpdateBillOfMaterial.md) - Revise component lines while the BOM remains draft.
- [activateBillOfMaterial](../commands/ActivateBillOfMaterial.md) - Validate and freeze the component line structure for selection at release.
- [deactivateBillOfMaterial](../commands/DeactivateBillOfMaterial.md) - Retire the BOM version without mutating lines on existing production-order snapshots.

### Query Definitions

- [getBillOfMaterial](../queries/GetBillOfMaterial.md) - Retrieve one BOM version with its component lines.
- [explodeBillOfMaterial](../queries/ExplodeBillOfMaterial.md) - Expand component lines into multi-level requirements for planning.
- [listBillOfMaterialsByItem](../queries/ListBillOfMaterialsByItem.md) - List BOM versions and lines for one parent item and scope.
- [detectBillOfMaterialCircularReference](../queries/DetectBillOfMaterialCircularReference.md) - Validate component line references for circular manufactured-item loops.

### Models

- BillOfMaterialLine

### Invariants

- Every BillOfMaterialLine belongs to exactly one BillOfMaterial version.
- `requiredQuantity` must be greater than zero.
- Component item must be a valid item reference.
- Inactive items cannot appear as component lines on a draft or active BOM.
- `scrapAssumption`, when provided, must be zero or greater.

### Relationships

- **Belongs To BillOfMaterial**: each line is subordinate to one [BillOfMaterial](./BillOfMaterial.md) version.
- **References Item (cross-module)**: `itemId` points to a component [Item](../../../item-management/docs/models/Item.md).
