# GetProductionOrder

## Overview

GetProductionOrder returns one production order with planning fields, release snapshots, work-progress rollup, and closeout status so planners and supervisors can inspect a single order end to end.

## Business Rules

- Production-order reference is required.
- The query returns any lifecycle status.
- The response includes selected or snapshotted BOM and routing context, quantity rollups, and linked cost-summary status.
- Child work-order summary data may be embedded for execution visibility.
- The returned snapshot should preserve the exact BOM type, routing revision, and production-state context that were in force for the order.

## Process Flow

```mermaid
flowchart TD
    A[Receive production-order reference] --> B[Load order, snapshots, and rollups]
    B --> C{Order found?}
    C -->|No| D[Return PRODUCTION_ORDER_NOT_FOUND]
    C -->|Yes| E[Return production-order detail]
```

## External Dependencies

- [GetManufacturingCostSummary](./GetManufacturingCostSummary.md) - Cost status may be embedded in the response.

## Error Scenarios

- **PRODUCTION_ORDER_NOT_FOUND**: Referenced production order does not exist

## Test Cases

- returns a production order with material requirements, work orders, and cost summary when found
- returns a production order with no cost summary when none exists
- returns error when the production order does not exist
