# GetGoodsReceipt

## Overview

GetGoodsReceipt retrieves a single goods receipt InventoryExecution by ID, including all associated InventoryExecutionLine rows.

## Business Rules

- Lookup key is goods receipt InventoryExecution id
- Always filters InventoryExecution by executionType = GOODS_RECEIPT
- Returns the full InventoryExecution record with nested InventoryExecutionLine records
- Returns null with an empty line list when no GOODS_RECEIPT execution matches the given ID

## Process Flow

```mermaid
flowchart TD
    A[Receive goods receipt execution id] --> B[Select InventoryExecution by id and GOODS_RECEIPT type]
    B --> C{Goods receipt found?}
    C -->|No| D[Return null and empty lines]
    C -->|Yes| E[Select InventoryExecutionLine rows]
    E --> F[Return execution and lines]
```

## External Dependencies

- None

## Error Scenarios

- Returns null if the goods receipt execution is not found

## Test Cases

- returns goods receipt execution with lines when found
- returns null when goods receipt execution does not exist
- returns goods receipt execution with empty lines when no lines exist
