# GetSalesOrder

## Overview

GetSalesOrder retrieves one sales order by identifier, returning header, line, customer, payment-term, and progress details needed by sales, fulfillment, and downstream billing workflows.

## Business Rules

- Lookup by id performs an exact sales-order match.
- Returned payload includes line-level fulfilled, billed, and remaining quantities.
- The query may return any `orderStatus`, including CANCELLED or CLOSED, together with its fulfillment and billing projections.

## Process Flow

```mermaid
flowchart TD
    A[Receive sales-order id] --> B[Query SalesOrder and SalesOrderLine]
    B --> C{Found?}
    C -->|No| D[Return null]
    C -->|Yes| E[Assemble order with progress details]
    E --> F[Return sales order]
```

## External Dependencies

- None

## Error Scenarios

- None (returns null when no matching sales order exists)

## Test Cases

- returns sales order when found by id
- returns line-level fulfilled and billed progress
- returns null when sales order is not found
