# ReactivateStorageLocation

## Permission Scope

location

## Overview

reactivateStorageLocation transitions a storage location from INACTIVE back to ACTIVE status. The parent Site must still be in ACTIVE status for the location to be reactivated.

## Business Rules

- Storage location must exist
- Storage location must be in INACTIVE status
- Parent Site must be in ACTIVE status

## Process Flow

```mermaid
flowchart TD
    A[Receive reactivate request] --> B{Location exists?}
    B -->|No| C[Return error: STORAGE_LOCATION_NOT_FOUND]
    B -->|Yes| D{Status is INACTIVE?}
    D -->|No| E[Return error: STORAGE_LOCATION_NOT_INACTIVE]
    D -->|Yes| F{Site ACTIVE?}
    F -->|No| G[Return error: SITE_INACTIVE]
    F -->|Yes| H[Update status to ACTIVE]
    H --> I[Return updated location]
```

## External Dependencies

- Organization module: getSite query used to validate the parent Site

## Error Scenarios

- **STORAGE_LOCATION_NOT_FOUND**: Referenced storage location does not exist
- **STORAGE_LOCATION_NOT_INACTIVE**: Storage location is not in INACTIVE status
- **SITE_INACTIVE**: Referenced site is not in ACTIVE status

## Test Cases

- returns error when not found
- returns error when already active
- returns error when site is inactive
- reactivates inactive location
