# ReactivateProduct

## Permission Scope

product

## Overview

reactivateProduct transitions a product from ARCHIVED back to ACTIVE status, allowing new variant generation with updated attribute values. This supports product relaunch scenarios where a previously discontinued product line is brought back.

## Business Rules

- Target product must exist
- Target product must be in ARCHIVED status
- After reactivation, the product behaves as any other ACTIVE product (variant generation is permitted)

## Process Flow

```mermaid
flowchart TD
    A[Receive reactivate request] --> B{Product exists?}
    B -->|No| C[Return error: PRODUCT_NOT_FOUND]
    B -->|Yes| D{Status is ARCHIVED?}
    D -->|No| E[Return error: INVALID_STATE_TRANSITION]
    D -->|Yes| F[Update status to ACTIVE]
    F --> G[Return reactivated product]
```

## External Dependencies

- None

## Error Scenarios

- **PRODUCT_NOT_FOUND**: Specified product ID does not exist
- **INVALID_STATE_TRANSITION**: Requested state transition is not allowed from the current status

## Test Cases

- returns error when product not found
- returns error when not in ARCHIVED status
- reactivates ARCHIVED product to ACTIVE
