# GetBillOfMaterial

## Overview

GetBillOfMaterial returns one BOM version with its component lines, effectivity window, scope, and status so planners and engineers can inspect the exact production recipe.

## Business Rules

- BOM reference is required.
- The query returns draft, active, or inactive versions.
- Component lines are returned in their maintained sequence order.
- The response includes `bomType`, scope, effectivity, and default-selection flags.

## Process Flow

```mermaid
flowchart TD
    A[Receive BOM reference] --> B[Load BOM and component lines]
    B --> C{BOM found?}
    C -->|No| D[Return BOM_NOT_FOUND]
    C -->|Yes| E[Return BOM detail]
```

## External Dependencies

- None

## Error Scenarios

- **BOM_NOT_FOUND**: Referenced BOM does not exist

## Test Cases

- returns a BOM with component lines when found
- returns draft BOM versions when requested
- returns inactive BOM versions when requested
- returns error when the BOM does not exist
