# MarkChannelOrderException

## Permission Scope

marketplace

## Overview

MarkChannelOrderException moves a pending channel order into EXCEPTION status with actionable retry context. It separates recoverable normalization or mapping failure from successful conversion flow.

## Business Rules

- Only PENDING_CONVERSION channel orders may enter EXCEPTION through this command.
- A non-empty error summary or retry context is required.

## Process Flow

```mermaid
flowchart TD
    A[Receive exception request] --> B[Load channel order]
    B --> C{Status is PENDING_CONVERSION?}
    C -->|No| D[Return INVALID_CHANNEL_ORDER_STATUS]
    C -->|Yes| E[Store error context and set status to EXCEPTION]
    E --> F[Return exceptional channel order]
```

## External Dependencies

- None

## Error Scenarios

- **CHANNEL_ORDER_NOT_FOUND**: Referenced channel order does not exist.
- **INVALID_CHANNEL_ORDER_STATUS**: Channel order status does not allow this operation
- **EXCEPTION_CONTEXT_REQUIRED**: Retry or troubleshooting context is required.

## Test Cases

- marks a pending channel order as exception with retry context
- throws when channel order is not pending conversion
- throws when exception context is empty
