# CreateValuationPolicy

## Permission Scope

inventoryMaster

## Overview

createValuationPolicy creates a new valuation policy that defines the costing method used to calculate inventory value. Supported costing methods are FIFO (First In, First Out), AVCO (Average Cost), and STANDARD_COST (fixed standard cost rate).

## Business Rules

- standardCostRate is required when costingMethod is STANDARD_COST
- standardCostRate is not required for FIFO or AVCO methods

## Process Flow

```mermaid
flowchart TD
    A[Receive create request] --> F{costingMethod is STANDARD_COST?}
    F -->|Yes| G{standardCostRate provided?}
    G -->|No| H[Return error: STANDARD_COST_RATE_REQUIRED]
    G -->|Yes| I[Create valuation policy]
    F -->|No| I
    I --> J[Return created policy]
```

## External Dependencies

- None

## Error Scenarios

- **STANDARD_COST_RATE_REQUIRED**: costingMethod is STANDARD_COST but no standardCostRate was provided

## Test Cases

- returns error when standard cost without rate
- creates FIFO policy
- creates AVCO policy
- creates standard cost policy with rate
