# Auditability and traceability matrix

## Required anchors

| Anchor | Where recorded |
| --- | --- |
| Original order | `sales_returns.sales_order_id` → `sales_orders` |
| Order line | `sales_return_lines.sales_order_line_id` → `sales_order_lines` |
| Fulfillment / stock out | `inventory_stock_movements` rows (`movement_type = stock_out`, `reference_type = sales_order_line`) |
| Return compensation | `inventory_stock_movements` rows (`movement_type = stock_in`, `reverses_movement_id` → stock_out id) |
| Return document | `sales_returns` (`status`, `processed_at`, `correlation_id`, `actor_user_id`) |

## Correlation

- `correlation_id` on the return header ties together all compensating movements issued in one process run (also forwarded into stock movement correlation where applicable).

## Actor and time

- `actor_user_id` on the return header identifies the operational actor for the processing step.
- `processed_at` marks when financial/inventory effects became effective for this document.

## Reconciliation

- Auditors can reconcile: **Σ(processed return qty per line) ≤ historical fulfilled**, and **Σ(compensating stock_in qty linked to a stock_out id) ≤ original stock_out magnitude** for that movement.
