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

### Query Definitions

- [getBillOfMaterial](../query/GetBillOfMaterial.md) - Retrieve one BOM version with its component lines.
- [explodeBillOfMaterial](../query/ExplodeBillOfMaterial.md) - Expand component lines into multi-level requirements for planning.
- [listBillOfMaterialsByItem](../query/ListBillOfMaterialsByItem.md) - List BOM versions and lines for one parent item and scope.
- [detectBillOfMaterialCircularReference](../query/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/model/Item.md).
