# GetTransferOrder

## Overview

getTransferOrder retrieves one TransferOrder with its lines and derived progress statuses.

## Business Rules

- Lookup key is TransferOrder id
- Returns null with an empty line list when no transfer order matches the id
- `shippingStatus` is derived from line shipped quantities
- `receivingStatus` is derived from line received quantities
- Derived statuses are not persisted header lifecycle states

## Process Flow

```mermaid
flowchart TD
    A[Receive transfer order id] --> B[Select TransferOrder]
    B --> C{TransferOrder found?}
    C -->|No| D[Return null and empty lines]
    C -->|Yes| E[Select TransferOrderLine rows]
    E --> F[Derive shippingStatus and receivingStatus]
    F --> G[Return transfer order, lines, and derived statuses]
```

## External Dependencies

- None

## Error Scenarios

- Returns null if the transfer order is not found

## Test Cases

- returns transfer order with lines and derived statuses
- returns null when transfer order does not exist
