# ListTransferOrders

## Overview

listTransferOrders lists TransferOrder headers with their lines and derived progress statuses.

## Business Rules

- Supports filtering by status, sourceSiteId, and destinationSiteId
- Orders results by createdAt descending
- Returns paginated results
- Derived shipment and receipt statuses are computed from returned lines

## Process Flow

```mermaid
flowchart TD
    A[Receive list filters] --> B[Select paginated TransferOrder rows]
    B --> C{Any rows?}
    C -->|No| D[Return empty page]
    C -->|Yes| E[Select TransferOrderLine rows for page]
    E --> F[Group lines by transfer order]
    F --> G[Derive shippingStatus and receivingStatus for each item]
    G --> H[Return paginated transfer orders]
```

## External Dependencies

- None

## Error Scenarios

- None

## Test Cases

- lists transfer orders with lines and derived statuses
- returns empty items when no transfer orders match
