# ListCategoryAssignmentsByProduct

## Overview

ListCategoryAssignmentsByProduct retrieves all category assignments for a given product. This is the inverse lookup of ListProductCategoryAssignments (which queries by categoryId). Used for displaying which categories a product belongs to and for validating multi-category assignment constraints.

## Business Rules

- Accepts `{ productId }` as the required input
- Returns all ProductCategoryAssignment records for the specified product as an array
- Returns an empty array if the product has no category assignments
- Each returned record includes full fields (id, productId, categoryId, timestamps)

## Process Flow

```mermaid
flowchart TD
    A[Receive productId] --> B[SELECT from ProductCategoryAssignment where productId = input.productId]
    B --> C{Results found?}
    C -->|Yes| D[Return array of assignment records]
    C -->|No| E[Return empty array]
```

## External Dependencies

- None

## Error Scenarios

- **PRODUCT_NOT_FOUND**: Specified product ID does not exist

## Test Cases

- returns assignments when found
- returns empty array when no assignments
