# confirmStockAdjustment

## Overview

Confirms a SUBMITTED Stock Adjustment, transitioning it from SUBMITTED to CONFIRMED. This is where stock is applied: the command posts inventory ledger entries and updates the affected `StockLevel` rows according to each line's effect (CORRECTION applies the line's `adjustmentDirection` to AVAILABLE stock; SCRAP writes off the line's `fromStockCategory`; BLOCK moves AVAILABLE → BLOCKED; UNBLOCK moves BLOCKED → AVAILABLE). Confirmation fails when there is not enough stock to decrease, scrap, or block.

## Modules Commands Used

- [inventory] confirmStockAdjustment

## Exception Handling

| Error Code | Description |
| --- | --- |
| INVENTORY_STOCK_ADJUSTMENT_NOT_FOUND | No stock adjustment exists for the given ID. |
| INVENTORY_INVALID_STATUS | The stock adjustment is not in SUBMITTED status and cannot be confirmed. |
| INVENTORY_ITEM_NOT_FOUND | A referenced item does not exist. |
| INVENTORY_INSUFFICIENT_STOCK | Stock is insufficient to decrease, scrap, block, or unblock. |
