# ListInventorySupplyPlans

## Overview

ListInventorySupplyPlans lists OPEN site-level supply projections for planning and ATP workflows. It supports filters by item, site, source document, source line, source type, and expected date range. At least one filter must be provided.

## Business Rules

- Accepts optional filters, with at least one required:
  - `itemId`
  - `siteId`
  - `sourceType`
  - `sourceId`
  - `sourceLineId`
  - `expectedFrom`
  - `expectedTo`
- Returns matching OPEN supply plans with computed `openQuantity`, clamped to zero
- Excludes CLOSED rows from the open supply view
- Supports pagination
- When filtering by `siteId`, returns plans directly assigned to that site

## Process Flow

```mermaid
flowchart TD
    A[Receive filter criteria] --> B{At least one filter?}
    B -->|No| C[Return error: NO_FILTER_PROVIDED]
    B -->|Yes| D[Apply OPEN status and input filters]
    D --> E[Query InventorySupplyPlan]
    E --> F[Compute openQuantity for each row]
    F --> G[Return paginated result]
```

## External Dependencies

- None

## Error Scenarios

- **NO_FILTER_PROVIDED**: At least one filter must be specified

## Test Cases

- lists supply plans by item
- lists supply plans by site
- lists supply plans by source document
- lists supply plans by expected date range
- returns error when no filter is provided
- computes open quantity for each row
- returns zero open quantity when received quantity exceeds expected quantity
- filters to OPEN supply plans
