# DeleteSalesItem

## Permission Scope

salesItem

## Overview

DeleteSalesItem withdraws an item from selling by removing the sales module's record for it. The item itself is untouched and may still be purchased or stocked; it simply can no longer be put on a new sales order line.

## Business Rules

- The referenced item must already hold a selling record
- Sales orders that already reference the item are left untouched — they carry their own frozen line values and remain fulfillable and billable
- Withdrawal is reversible by adopting the item again, which starts a fresh selling record

## Process Flow

```mermaid
flowchart TD
    A[Receive withdrawal request for an item] --> B{Item has a selling record?}
    B -->|No| C[Return ITEM_NOT_SELLABLE]
    B -->|Yes| D[Delete the selling record]
    D --> E[Item can no longer be put on new sales order lines]
```

## External Dependencies

- None

## Error Scenarios

- **ITEM_NOT_SELLABLE**: Referenced item holds no selling record and cannot be sold

## Test Cases

- withdraws an adopted item from selling
- returns error when the item has no selling record
