# Spec Delta

## Purpose

Record technical sparepart consumption for work orders using auditable Inventory movements without duplicating checkout or financial records.

## ADDED Requirements

### Requirement: Ledger-based usage
Work-order usage SHALL derive from its posted issues, returns and reversals. The system SHALL NOT persist a separately editable usage total or attach existing public checkout transactions implicitly. Financial fields SHALL NOT appear in this feature.

#### Scenario: User views used parts
- **WHEN** an order has issues and partial returns
- **THEN** its detail shows net usage and related transactions without prices

### Requirement: Proposed posting authority
Subject to policy approval, ADMIN/SUPERVISOR SHALL post work-order issues and returns directly. TECHNICIAN SHALL read usage but not directly deduct stock. Posting SHALL require an IN_PROGRESS WO, a positive integer quantity and reason, and use current available stock.

#### Scenario: Technician attempts direct issue
- **WHEN** a technician submits a stock issue without privileged authority
- **THEN** the API rejects it without creating a movement

### Requirement: Safe posting
Posting SHALL atomically update the balance and ledger with WO attribution and audit. A stable request key SHALL prevent duplicate effects; changed payload with the same key SHALL conflict. Concurrent issues SHALL never overdraw available stock.

#### Scenario: Lost issue response
- **WHEN** the same key and payload are retried after commit
- **THEN** the existing result is returned without another deduction

### Requirement: Explicit corrections
Removing a persisted usage row SHALL NOT delete its history. Returns SHALL not exceed net issued quantity. Cancelling a WO SHALL NOT return goods automatically. Privileged corrections on terminal work SHALL use explicit reasoned Inventory operations and refresh the displayed net usage.

#### Scenario: Cancel work after actual consumption
- **WHEN** work with posted consumption is cancelled
- **THEN** stock remains unchanged until an explicit valid return or reversal is recorded
