# deleteCategory

## Overview

Permanently removes a leaf category that has no child categories or assigned products.

## Modules Commands Used

- `product-management.DeleteProductCategory` — checks for children and product assignments before deleting the category

## Exception Handling

| Error Code | Description |
| --- | --- |
| CATEGORY_NOT_FOUND | No category exists with the given ID |
| HAS_CHILDREN | The category cannot be deleted because it has one or more child categories |
| HAS_ASSIGNMENTS | The category cannot be deleted because products are assigned to it |
