# ValuationPolicy

## Description

ValuationPolicy defines the costing method used to value inventory for a set of items. The supported methods are STANDARD (versioned standard cost generations per item), FIFO (actual costing over receipt layers), and AVERAGE (actual costing at a moving average).

A policy belongs to a company: charts of accounts and general ledgers are company-scoped, so the policy carries that company's posting accounts, and the costing journals of its items post to that company's ledger. The posting accounts are: inventory (asset side), accrual (uninvoiced-receipt counterpart at the order price, relieved at that same price when accounts payable books the invoice), invoice price variance (clearing: accounts payable debits it for the signed invoice-versus-order price difference and the acquisition cost adjustment washes it when the difference lands on the receipts; see [Acquisition Cost Adjustment](../feature/acquisition-cost-adjustment.md)), COGS, PPV (purchase price variance), adjustment (inventory gain/loss counterpart for corrections and scrap write-offs), standard cost adjustment (revision revaluations), and consumed price variance (price variances that cannot be restated to their consumption — consumed AVERAGE stock). These reference coa-management Accounts of the owning company, validated when the policy is created or updated; the financial-accounting journal commands validate them again at posting time.

The policy is the unit of account determination for its items: a company's default accounts are those of its default policy (at most one per company), and item-level overrides are expressed by assigning the item a dedicated policy carrying different accounts. Items are attached to a policy per company via [setItemValuationPolicy](../command/SetItemValuationPolicy.md); items without an ItemValuation record are auto-assigned the movement company's default policy on their first valuation-affecting movement, so routine item onboarding needs no per-item assignment step.

Method-specific cost state is not stored on the policy: standard costs live per item as versioned [StandardCost](./StandardCost.md) generations, FIFO costs live per layer as [FifoCost](./FifoCost.md) price rows, and moving averages live per item and company as [AverageCost](./AverageCost.md) history rows.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [createValuationPolicy](../command/CreateValuationPolicy.md) - Create a new valuation policy with a costing method and posting accounts
- [updateValuationPolicy](../command/UpdateValuationPolicy.md) - Update a valuation policy (e.g., rename, change posting accounts)

### Query Definitions

- [getValuationPolicy](../query/GetValuationPolicy.md) - Retrieve a valuation policy by id
- [listValuationPolicies](../query/ListValuationPolicies.md) - List valuation policies, optionally filtered by costing method

### Models

- ValuationPolicy

### Invariants

- Name is required
- Belongs to a company; the owning company cannot be changed
- At most one policy per company is marked as the default
- All eight posting accounts (inventory, accrual, invoice price variance, COGS, PPV, adjustment, standard cost adjustment, consumed price variance) are required, so a policy fully specifies where every costing fact posts

### Relationships

- **References Company**: Each valuation policy belongs to a Company from the organization module
- **Has many ItemValuation**: A valuation policy is associated with multiple item valuations
