# GetStockMovement

## Overview

GetStockMovement retrieves a single stock movement by id with all its movement lines. It returns the full record including current status, movement type, and nested StockMoveLine records with item, quantity, and location details.

## Business Rules

- Requires `id`
- Returns the full StockMovement record with nested StockMoveLine records
- Each movement line includes:
  - `itemId`, `quantity`
  - `sourceStorageLocationId` and/or `destinationStorageLocationId` depending on movement type
  - Optional `lotId`, `serialNumberId`
- Returns null if no matching stock movement is found

## Process Flow

```mermaid
flowchart TD
    A[Receive id] --> B[SELECT from StockMovement where id matches]
    B --> C{Movement found?}
    C -->|Yes| D[Include all StockMoveLine records]
    D --> E[Return StockMovement with lines]
    C -->|No| F[Return null]
```

## External Dependencies

- None

## Error Scenarios

- **STOCK_MOVEMENT_NOT_FOUND**: No stock movement matches the given id — caller receives null

## Test Cases

- returns stock movement when found
- returns null when not found
- includes all movement lines
- includes source and destination locations per line
