# ReleaseSalesOrderCreditHold

## Permission Scope

salesOrder

## Overview

ReleaseSalesOrderCreditHold removes a commercial hold and returns the order to its executable lifecycle. It restores downstream shipment and invoice eligibility without losing prior fulfillment or billing evidence.

## Business Rules

- Only CREDIT_HOLD orders may be released.
- The prior executable progress baseline must remain intact after release.

## Process Flow

```mermaid
flowchart TD
    A[Receive release request] --> B[Load sales order]
    B --> C{Status is CREDIT_HOLD?}
    C -->|No| D[Return INVALID_ORDER_STATUS]
    C -->|Yes| E[Restore executable lifecycle status]
    E --> F[Return released order]
```

## External Dependencies

- None

## Error Scenarios

- **SALES_ORDER_NOT_FOUND**: Referenced sales order does not exist.
- **INVALID_ORDER_STATUS**: Sales order status does not allow this operation

## Test Cases

- releases a held order back to executable status
- preserves shipment and invoice progress when releasing hold
- throws when order is not on credit hold
