# ListGoodsReceipts

## Overview

ListGoodsReceipts lists InventoryExecution records whose executionType is GOODS_RECEIPT and includes their InventoryExecutionLine rows.

## Business Rules

- Always filters InventoryExecution by executionType = GOODS_RECEIPT
- Accepts optional filters for status, sourceDocumentType, sourceDocumentId, and effectiveDate range
- Results are ordered by createdAt descending
- Supports limit and offset pagination
- Returns hasNextPage when more records are available
- Returns an empty list when no records match

## Process Flow

```mermaid
flowchart TD
    A[Receive optional filters] --> B[Build InventoryExecution query]
    B --> C[Apply GOODS_RECEIPT type filter]
    C --> D[Apply optional filters and pagination]
    D --> E[Load page of executions]
    E --> F{Any executions?}
    F -->|No| G[Return empty items]
    F -->|Yes| H[Load InventoryExecutionLine rows]
    H --> I[Group lines by execution]
    I --> J[Return items and hasNextPage]
```

## External Dependencies

- None

## Error Scenarios

- Returns empty list if no matching records exist

## Test Cases

- lists goods receipt executions with lines
- returns empty list when no matches
