# ProductionOrderCostBaseline

## Description

ProductionOrderCostBaseline stores the frozen planned cost figures established at production-order release. It owns the planned material, labor, machine, and overhead cost totals along with the currency code so that variance analysis always compares actuals against an immutable release-time plan.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [releaseProductionOrder](../commands/ReleaseProductionOrder.md) - Create the frozen cost baseline when the production order is released.

### Query Definitions

- [getProductionOrder](../queries/GetProductionOrder.md) - Retrieve the cost baseline as part of the parent production order.

### Models

- ProductionOrderCostBaseline

### Invariants

- Every ProductionOrder has at most one ProductionOrderCostBaseline, created at release.
- The baseline is immutable once created; later work-center rate or BOM changes do not affect it.
- All planned cost fields are zero or greater.
- `currencyCode` is required and must be a valid ISO 4217 code.
- The baseline exists only on orders in `RELEASED`, `IN_PROGRESS`, `COMPLETED`, `TECHNICALLY_COMPLETE`, or `CLOSED`.

### Relationships

- **Belongs To ProductionOrder**: the baseline is owned by one [ProductionOrder](./ProductionOrder.md).
- **Feeds ManufacturingCostSummary**: the frozen baseline drives planned totals in [ManufacturingCostSummary](./ManufacturingCostSummary.md) variance calculations.
