# GetStockAdjustment

## Overview

GetStockAdjustment retrieves a single StockAdjustment by ID, including all associated StockAdjustmentLines. This serves as the detail view for a specific stock adjustment, providing the full picture of the adjustment type, approval status, reason, and all line-level details.

## Business Rules

- Requires `stockAdjustmentId`
- Returns the full StockAdjustment record with nested StockAdjustmentLine records
- Each StockAdjustmentLine includes: `itemId`, `storageLocationId`, `quantity`, `adjustmentDirection` (INCREASE or DECREASE), and optional `lotId`, `serialNumberId`, `unitCost`
- Returns `null` if no StockAdjustment matches the given ID

## Process Flow

```mermaid
flowchart TD
    A[Receive stockAdjustmentId] --> B[SELECT from StockAdjustment where id matches]
    B --> C{StockAdjustment found?}
    C -->|Yes| D[SELECT all StockAdjustmentLines for this adjustment]
    D --> E[Return StockAdjustment with lines]
    C -->|No| F[Return null]
```

## External Dependencies

- None

## Error Scenarios

- Returns `null` if the StockAdjustment is not found

## Test Cases

- returns null when not found
- returns stock adjustment with lines when found
- returns stockAdjustment with empty lines when no lines exist
