# Stock Count & Warehouse Freeze v22

## Whole-warehouse freeze

Opening an active stock count creates a warehouse freeze.

While frozen, normal inventory ledger posting to that warehouse is rejected.

This prevents stock-changing business operations from invalidating count variances while the
physical count is in progress.

## Blind count

Stock counts default to `blind_count=true`.

While the count is active:
- users submit counted quantity
- API does not expose the system quantity snapshot

After posting:
- system snapshot is visible
- variance is visible

## Snapshot and variance

For each counted line:

variance = counted quantity - system quantity snapshot

Examples:
- system 10, counted 7 -> variance -3
- system 4, counted 6 -> variance +2

## Posting

Posting the count:
1. locks the stock count
2. posts variance movements through the immutable inventory ledger
3. bypasses the freeze only for those stock-count variance movements
4. marks the count posted
5. releases the warehouse freeze

The ledger remains the source of truth.

## APIs

- POST /api/v1/inventory/stock-counts
- GET /api/v1/inventory/stock-counts/{stockCountId}
- PUT /api/v1/inventory/stock-counts/{stockCountId}/lines
- POST /api/v1/inventory/stock-counts/{stockCountId}/post

## Permission

- inventory.stock_count

## Next

Inventory v23:
- batch / lot foundation
- expiry dates
- FEFO allocation
- traceability / recall support
