# ListPipelineLabelsByItem

## Overview

Lists all labels currently attached to a given item, ordered by label `name` ascending. Joins through PipelineItemLabel to resolve the label rows.

## Business Rules

- PipelineItem ID is required and must reference an existing item
- Results are ordered by label `name` ascending
- Returns an empty list when the item has no labels attached

## Process Flow

```mermaid
flowchart TD
    A[Receive listPipelineLabelsByItem input] --> B{PipelineItem exists?}
    B -->|No| C[Return ITEM_NOT_FOUND]
    B -->|Yes| D[Join PipelineLabel with PipelineItemLabel on labelId where PipelineItemLabel.itemId matches]
    D --> E[Order by PipelineLabel.name ascending]
    E --> F[Return list of PipelineLabel]
```

## External Dependencies

- None

## Error Scenarios

- **ITEM_NOT_FOUND**: Specified item ID does not exist

## Test Cases

- returns labels attached to the item ordered by name ascending
- returns empty list when the item has no labels
- returns error when item does not exist
