# ReactivateItem

## Permission Scope

item

## Overview

reactivateItem transitions an item from INACTIVE back to ACTIVE status, making a previously discontinued SKU available for transactions again. This supports scenarios such as bringing back seasonal products or restoring items after a temporary suspension.

## Business Rules

- Target item must exist in the system
- Target item must be in INACTIVE status
- After reactivation, the item can participate in new transactions
- All item data (SKU, barcode, UoM, name) is preserved from before deactivation
- Bulk reactivation is not supported — reactivation is expected to be a targeted, individual operation since bringing back discontinued items requires deliberate per-item review

## Process Flow

```mermaid
flowchart TD
    A[Receive reactivate request] --> B{Item exists?}
    B -->|No| C[Return error: not found]
    B -->|Yes| D{Status is INACTIVE?}
    D -->|No| E[Return error: invalid state transition]
    D -->|Yes| F[Update status to ACTIVE]
    F --> G[Return reactivated item]
```

## External Dependencies

- None

## Error Scenarios

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

## Test Cases

- returns error when item does not exist
- returns error when item is not INACTIVE
- returns error when item is DRAFT
- reactivates an INACTIVE item
