# ListAttributeAssignmentsByAttribute

## Overview

ListAttributeAssignmentsByAttribute retrieves all product assignments for a given attribute. Used as a guard check before attribute deletion to enforce the constraint that attributes assigned to any product cannot be deleted. Also used to check attribute value usage on ACTIVE products before removing values.

## Business Rules

- Searches ProductAttributeAssignment table for all records matching the given attributeId
- Returns all matching assignment records as an array
- Returns an empty array if the attribute is not assigned to any product

## Process Flow

```mermaid
flowchart TD
    A[Receive attributeId] --> B[SELECT from ProductAttributeAssignment where attributeId = input]
    B --> C{Assignments found?}
    C -->|Yes| D[Return assignment records]
    C -->|No| E[Return empty array]
```

## External Dependencies

- None

## Error Scenarios

None

## Test Cases

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