# ListWarehouses

## Overview

ListWarehouses lists warehouses filtered by site or status. It returns summary-level records without nested storage locations — use GetWarehouse for full detail. Results are ordered by name ascending.

## Business Rules

- Accepts optional filters:
  - `siteId` — filter by site
  - `status` — filter by warehouse status (e.g., Active, Inactive)
- Returns Warehouse records **without** nested StorageLocation records
- Results are ordered by `name` ascending
- Returns an empty list if no matching records exist

## Process Flow

```mermaid
flowchart TD
    A[Receive optional filters] --> B[Build query from provided filters]
    B --> C[Apply siteId, status filters as provided]
    C --> D[Order by name ascending]
    D --> E{Records found?}
    E -->|Yes| F[Return list of Warehouse records]
    E -->|No| G[Return empty list]
```

## External Dependencies

- None

## Error Scenarios

- Returns empty list if no matching records exist

## Test Cases

- lists warehouses by site
- lists warehouses by status
- returns empty list when no matches
- orders by name ascending
- does not include storage locations
