# GetWorkOrder

## Overview

GetWorkOrder returns one work order with operation context, status, quantity rollups, actual time, pause history, and handoff evidence.

## Business Rules

- Work-order reference is required.
- The query returns any lifecycle status.
- Execution-event history may be returned in chronological order.
- The response includes parent production-order reference and work-center context.
- The response should preserve the routed operation sequence, current status, and recorded handoff evidence for the work order.

## Process Flow

```mermaid
flowchart TD
    A[Receive work-order reference] --> B[Load work order and execution events]
    B --> C{Work order found?}
    C -->|No| D[Return WORK_ORDER_NOT_FOUND]
    C -->|Yes| E[Return work-order detail]
```

## External Dependencies

- None

## Error Scenarios

- **WORK_ORDER_NOT_FOUND**: Referenced work order does not exist

## Test Cases

- returns a work order with execution history when found
- returns paused work orders with prior pause data
- returns a work order with handoff evidence and parent order context
- returns error when the work order does not exist
