# ListWorkOrdersByWorkCenter

## Overview

ListWorkOrdersByWorkCenter lists work orders queued or executing at one work center across multiple production orders so supervisors can review shared bottlenecks and dispatch work.

## Business Rules

- Work-center reference is required.
- Optional filters may restrict by work-order status or planned execution date range.
- Results may span multiple production orders, but every returned work order must belong to the requested work center only.
- Results are ordered for execution review, prioritizing active bottleneck work by status and planned execution timing.
- The query returns summary fields suitable for a dispatch or bottleneck board, including production-order reference, operation sequence, status, planned and completed quantities, and current execution timestamps.

## Process Flow

```mermaid
flowchart TD
    A[Receive work-center reference and filters] --> B[Validate work-center input]
    B --> C[Query work orders assigned to the work center]
    C --> D[Apply optional status and date-range filters]
    D --> E[Order for execution review]
    E --> F[Return cross-order work-order list]
```

## External Dependencies

- None

## Error Scenarios

- **WORK_CENTER_REFERENCE_REQUIRED**: Work-center reference was not provided.
- **WORK_CENTER_NOT_FOUND**: Referenced work center does not exist

## Test Cases

- lists pending and in-progress work orders for one work center across multiple production orders
- filters work orders by status when provided
- orders the result for bottleneck review by execution priority and planned timing
- returns summary fields with production-order reference operation sequence and progress totals
- returns an empty list when the work center has no assigned work orders
- returns error when the work-center reference is missing
- returns error when the work center does not exist
