# settleOutboundShipment

## Overview

Settles (posts) a DRAFT outbound shipment (出庫), transitioning it DRAFT → POSTED. The resolver posts the shipment through the outbound-shipment module's `postOutboundShipment`, which reduces AVAILABLE stock (ledger + StockLevel, consuming any matching reservations).

For `SALES_ORDER` source lines, posting also advances `SalesOrderLine.fulfilledQuantity` and recalculates `SalesOrder.fulfillmentStatus` in the same transaction.

Input: `id`.

## Modules Commands Used

- [outbound-shipment] PostOutboundShipment

## Exception Handling

| Error Code | Description |
| --- | --- |
| OUTBOUND_SHIPMENT_INVALID_STATUS | The outbound shipment is not in DRAFT status and cannot be posted |
| OUTBOUND_SHIPMENT_EMPTY_SHIPMENT_LINES | The outbound shipment has no lines |
| INVENTORY_INSUFFICIENT_STOCK | There is not enough AVAILABLE stock to issue |
