# updateProductCategories

## Overview

Updates a product's category assignments. Accepts the full list of desired category IDs, computes the diff against current assignments, and assigns/removes as needed.

## Modules Commands Used

- `product-management.AssignProductToCategory` — assigns newly selected categories
- `product-management.RemoveProductFromCategory` — removes deselected categories

## Exception Handling

| Error Code | Source | Description |
| --- | --- | --- |
| PRODUCT_NOT_FOUND | AssignProductToCategory | The specified product does not exist |
| CATEGORY_NOT_FOUND | AssignProductToCategory | A specified category does not exist |
| ASSIGNMENT_NOT_FOUND | RemoveProductFromCategory | The category assignment does not exist (silently ignored) |
