# DeactivateSalesPriceRule

## Permission Scope

salesPricing

## Overview

DeactivateSalesPriceRule removes an active SalesPriceRule from future operational use while preserving historical references.

## Business Rules

- Only ACTIVE SalesPriceRule records may be deactivated.
- Historical references to the SalesPriceRule must remain valid after deactivation.

## Process Flow

```mermaid
flowchart TD
    A[Receive deactivate request] --> B[Load SalesPriceRule]
    B --> C{Status is ACTIVE?}
    C -->|No| D[Return INVALID_SALESPRICERULE_STATUS]
    C -->|Yes| E[Set status to INACTIVE]
    E --> F[Return deactivated SalesPriceRule]
```

## External Dependencies

- None

## Error Scenarios

- **SALESPRICERULE_NOT_FOUND**: Referenced SalesPriceRule does not exist
- **INVALID_SALESPRICERULE_STATUS**: SalesPriceRule status does not allow this operation

## Test Cases

- deactivates an active SalesPriceRule
- throws when SalesPriceRule is not active
