# GetProductCategoryAssignment

## Overview

GetProductCategoryAssignment retrieves a specific product-to-category assignment by the composite key of productId and categoryId. Used for duplicate detection during assignment creation and existence verification before removal.

## Business Rules

- Searches ProductCategoryAssignment table using both productId AND categoryId as a composite filter
- Returns the full assignment record if found (id, productId, categoryId, timestamps)
- Returns null if no assignment exists for the given pair

## Process Flow

```mermaid
flowchart TD
    A[Receive productId + categoryId] --> B[SELECT from ProductCategoryAssignment where productId = input AND categoryId = input]
    B --> C{Assignment found?}
    C -->|Yes| D[Return assignment record]
    C -->|No| E[Return null]
```

## External Dependencies

- None

## Error Scenarios

- **ASSIGNMENT_NOT_FOUND**: No assignment exists for the specified product and attribute or category combination

## Test Cases

- returns assignment when found
- returns null when not found
