# GetRouting

## Overview

GetRouting returns one routing revision with ordered operations, standard times, work-center assignments, and lifecycle status.

## Business Rules

- Routing reference is required.
- Company scope is required when routing codes are only unique within a company.
- The query returns draft, active, or inactive routings.
- Operations are returned in sequence order with instruction and work-center context.

## Process Flow

```mermaid
flowchart TD
    A[Receive routing reference and scope] --> B[Load routing and operations]
    B --> C{Routing found?}
    C -->|No| D[Return ROUTING_NOT_FOUND]
    C -->|Yes| E[Return routing detail]
```

## External Dependencies

- None

## Error Scenarios

- **ROUTING_NOT_FOUND**: Requested routing does not exist.
- **COMPANY_SCOPE_REQUIRED**: Company scope was not provided when needed to resolve the routing.

## Test Cases

- returns a routing with ordered operations when found
- returns inactive routing revisions when requested
- returns routing data for the requested company scope
- returns error when the routing does not exist
- returns error when company scope is not provided
