# InventoryCountLine

## Description

InventoryCountLine represents a single item-location combination within an inventory count session. Each line captures the system quantity (snapshot at count start) and the counted quantity (entered by the counter), with the variance computed as the difference. Lines follow a review workflow: PENDING → APPROVED/REJECTED/RECOUNT.

Within-tolerance variances are auto-approved. Exceeding-tolerance variances require explicit approval. Approved variances generate inventory adjustments with the reason "inventory-count". Blind count mode hides system quantities from counters.

## Domain Model Definitions

### Model type

Stateful

#### State Transitions

```mermaid
stateDiagram-v2
    [*] --> Pending: startInventoryCount (creates lines)
    Pending --> Approved: approveCountLine (or auto-approve within tolerance)
    Pending --> Rejected: rejectCountLine
    Pending --> Recount: rejectCountLine (with recount)
    Recount --> Pending: recordCountLine (re-enters count)
    Rejected --> Pending: recordCountLine (re-counted)
```

### Command Definitions

- [recordCountLine](../commands/RecordCountLine.md) - Record or re-record the counted quantity for a count line
- [approveCountLine](../commands/ApproveCountLine.md) - Approve a count line variance
- [rejectCountLine](../commands/RejectCountLine.md) - Reject a count line or request a recount

### Query Definitions

- Inventory count lines are included in inventory count queries

### Models

- InventoryCountLine

### Invariants

- Variance = countedQuantity - systemQuantity
- Within-tolerance variances are auto-approved
- Exceeding-tolerance variances require explicit approval
- Approved variances generate inventory adjustments with reason "inventory-count"
- Blind count mode hides system quantities from counters

### Relationships

- **Belongs to InventoryCount**: Each count line belongs to a single inventory count session
- **References Item**: Each count line references an Item from the item-management module
- **References StorageLocation**: Each count line targets a specific storage location
