# ListItemValuations

## Overview

ListItemValuations lists valuation summaries for multiple items. It supports inventory value reporting by allowing filters on specific items or valuation policies.

## Business Rules

- Optionally accepts `itemIds` — an array of item UUIDs to filter by
- Optionally accepts `valuationPolicyId` — filter by a specific valuation policy
- Returns a list of ItemValuation records, each with computed `costPerUnit` (`totalValue / totalQuantity`)
- Supports pagination via `limit` and `offset` parameters; returns `hasNextPage` to indicate more results
- Returns an empty list if no matching records exist

## Process Flow

```mermaid
flowchart TD
    A[Receive optional filters] --> B{itemIds provided?}
    B -->|Yes| C[SELECT from ItemValuation where itemId in itemIds]
    B -->|No| D{valuationPolicyId provided?}
    C --> D
    D -->|Yes| E[Filter by valuationPolicyId]
    D -->|No| F[No additional filter]
    E --> G[Compute costPerUnit for each record]
    F --> G
    G --> H{Records found?}
    H -->|Yes| I[Return list of ItemValuation records]
    H -->|No| J[Return empty list]
```

## External Dependencies

- None

## Error Scenarios

- Returns empty list if no matching records exist

## Test Cases

- lists all item valuations
- filters by item IDs
- filters by valuation policy
- returns empty list when no matches
