# ListGoodsIssues

## Overview

ListGoodsIssues lists InventoryExecution records whose executionType is GOODS_ISSUE and includes their InventoryExecutionLine rows.

## Business Rules

- Always filters InventoryExecution by executionType = GOODS_ISSUE
- 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_ISSUE 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 issue executions with lines
- returns empty list when no matches
