# GetItemValuation

## Overview

GetItemValuation retrieves the current valuation summary for an item — total quantity, total value, and cost per unit. It includes the costing method from the associated valuation policy.

## Business Rules

- Requires `itemId` and `valuationPolicyId`
- Returns a single ItemValuation record containing:
  - `totalQuantity` — total inventory quantity for the item
  - `totalValue` — total monetary value of inventory
  - `costPerUnit` — computed as `totalValue / totalQuantity`
  - `costingMethod` — the costing method from the valuation policy (e.g., FIFO, weighted average, standard cost)
- Includes valuation policy details in the response
- Returns error if no valuation record exists for the item

## Process Flow

```mermaid
flowchart TD
    A[Receive itemId and valuationPolicyId] --> B[SELECT from ItemValuation where itemId and valuationPolicyId match]
    B --> C{Valuation found?}
    C -->|Yes| D[Include valuation policy details]
    D --> E[Return ItemValuation record]
    C -->|No| F[Return ITEM_VALUATION_NOT_FOUND error]
```

## External Dependencies

- None

## Error Scenarios

- **ITEM_VALUATION_NOT_FOUND**: No valuation record exists for the specified item

## Test Cases

- returns valuation when found
- includes costing method from policy
- returns error when not found
- costPerUnit equals totalValue divided by totalQuantity
