# ActivateItem

## Permission Scope

item

## Overview

activateItem transitions an item from DRAFT to ACTIVE status, making it available for use in transactions across downstream modules (Sales, Purchasing, Inventory). Since name, SKU, and UoM are required at creation time, no completeness validation is needed at activation.

## Business Rules

- Target item must exist in the system
- Target item must be in DRAFT status
- After activation, the item can participate in new transactions

## Process Flow

```mermaid
flowchart TD
    A[Receive activate request] --> B{Item exists?}
    B -->|No| C[Return error: not found]
    B -->|Yes| D{Status is DRAFT?}
    D -->|No| E[Return error: invalid state transition]
    D -->|Yes| F[Update status to ACTIVE]
    F --> G[Return activated 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 DRAFT
- returns error when item is INACTIVE
- activates a DRAFT item
