# ChannelOrderLine

## Description

ChannelOrderLine stores the normalized line-level payload under a `ChannelOrder`. It preserves the external line identity, resolved listing or item mappings, quantity, price context, and normalized troubleshooting payload needed before conversion to internal sales-order lines.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [recordChannelOrder](../command/RecordChannelOrder.md) - Create or refresh normalized line payload under the parent channel order.
- [convertChannelOrder](../command/ConvertChannelOrder.md) - Consume mapped channel-order lines when materializing the internal sales order.

### Query Definitions

- [getChannelOrder](../query/GetChannelOrder.md) - Return one normalized channel order with its linked conversion context.
- [listChannelOrdersByStatus](../query/ListChannelOrdersByStatus.md) - Return operational queues where line-level mapping context may need review.

### Models

- ChannelOrderLine

### Invariants

- Every channel-order line belongs to exactly one `ChannelOrder`.
- Quantity must remain greater than zero for a normalized commercial line.
- Listing, item, currency, and unit mappings are optional during ingestion but must be resolvable before successful conversion.
- Normalized line payload must preserve sufficient source detail for support and replay workflows.

### Relationships

- **Belongs To ChannelOrder**: `channelOrderId` ties the line to its parent inbound order.
- **References Listing**: `listingId` stores the resolved marketplace or storefront listing when available.
- **References Item (cross-module)**: `itemId` stores the resolved internal sellable item when mapping succeeds.
- **References primitives**: `currencyId` and `uomId` preserve the normalized commercial measurement context.
