# RemoveProductFromCategory

## Permission Scope

product

## Overview

removeProductFromCategory removes the many-to-many link between a product and a product category. This does not delete either the product or the category — it only removes the classification relationship.

## Business Rules

- The assignment (productId, categoryId) must exist
- Removal only affects the assignment record, not the product or category themselves
- Products in any status (DRAFT, ACTIVE, ARCHIVED) can have category assignments removed

## Process Flow

```mermaid
flowchart TD
    A[Receive remove request] --> B{Assignment exists?}
    B -->|No| C[Return error: ASSIGNMENT_NOT_FOUND]
    B -->|Yes| D[Delete assignment record]
    D --> E[Return success]
```

## External Dependencies

- None

## Error Scenarios

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

## Test Cases

- should return AssignmentNotFoundError when assignment does not exist
- should remove assignment successfully
