# ReactivateDepartment

## Permission Scope

organizationUnit

## Overview

ReactivateDepartment transitions a department from INACTIVE back to ACTIVE status, restoring it for new operational assignments. This supports scenarios where a previously deactivated department is needed again.

## Business Rules

- Department must exist
- Department must be in INACTIVE status

## Process Flow

```mermaid
flowchart TD
    A[Receive reactivate request] --> B{Department exists?}
    B -->|No| C[Return error: DEPARTMENT_NOT_FOUND]
    B -->|Yes| D{Department in INACTIVE?}
    D -->|No| E[Return error: INVALID_STATE]
    D -->|Yes| F[Set status: ACTIVE]
    F --> G[Return reactivated department]
```

## External Dependencies

- None

## Error Scenarios

- **DEPARTMENT_NOT_FOUND**: Specified department ID does not exist
- **INVALID_STATE**: Target entity is not in a valid status for this operation

## Test Cases

- reactivates INACTIVE department
- throws when department does not exist
- throws when department is already ACTIVE
