# ListShiftPatterns

## Overview

listShiftPatterns returns a paginated list of all reusable ShiftPatterns, for pattern-picker UIs and administrative pattern management screens.

## Business Rules

- Accepts pagination parameters (e.g. `limit` / `cursor`); no required filters
- Returns all patterns regardless of `kind`, ordered by a stable order (e.g. `code` ascending)
- Each pattern in the list includes its `code`, `name`, and `kind`; segment detail may be omitted from the list shape and fetched via `getShiftPattern` for a specific pattern
- Reference/master data: the list reflects the current, non-effective-dated state of each pattern

## Process Flow

```mermaid
flowchart TD
    A[Receive pagination params] --> B[Fetch all ShiftPatterns]
    B --> C[Sort by code]
    C --> D[Apply pagination]
    D --> E[Return paginated list of patterns]
```

## External Dependencies

- [shiftSchedule::ShiftPattern](../model/ShiftPattern.md) model — entity being queried

## Error Scenarios

- **INVALID_PAGINATION**: pagination cursor or limit is malformed

## Test Cases

- returns a paginated list of ShiftPatterns
- list includes patterns of every kind (DAY / EARLY / LATE / NIGHT / ON_CALL)
- returns an empty page when no patterns exist
- paginates results according to the given limit and cursor
