Lifecycle & Audit Operations
Archiving, Disabling, Deleting & State Restoration
Retiring discontinued merchandise requires strict accounting safety to avoid corrupting past fiscal reports, sales receipts, or warehouse batch movements.
1. Four Lifecycle States Compared
| Lifecycle State | isActive | isArchived | POS Visibility | Accounting Records |
|---|---|---|---|---|
| Active | true | false | Visible & sellable | Live in stock reports |
| Disabled (Inactive) | false | false | Hidden from POS | Preserved in inventory list |
| Archived | false | true | Hidden from POS | Moved to vault; historical data preserved |
| Permanently Deleted | — | — | Erased | Blocked if historical sales/batches exist |
2. Archiving a Product (Soft Deletion)
When an item is discontinued, archiving ensures fiscal and transaction integrity:
- Open the item in the product view at
/inventory/products/[id]. - In the top sticky header, click the Archive Product button.
- The system executes an atomic transaction:
- Sets
isArchived: trueandisActive: falseon the product. - Cascades
isActive: falseto all product variants. - Writes an immutable entry to the tenant
AuditLog. - Emits real-time SSE / WebSocket events notifying open POS terminals to purge the item from active carts.
- Sets
- The product is relocated to the Archived Items Vault at
/inventory/archived.
3. Restoring Archived Items
Archived products can be reactivated at any time:
- Navigate to
/inventory/archived. - Search or select the item to open its details view.
- Click the Unarchive Product button in the top header.
- The product and its variants immediately return to active status and reappear in storefront and register catalogs.
4. Point-in-Time State Recovery (Activity Tab)
For Owners and Administrators, every creation, modification, price update, and archive event is tracked in the Activity tab:
Each log entry includes the actor name, timestamp, and before-and-after JSON diffs. If an operator accidentally modified pricing or variant definitions, clicking Revert State restores the exact snapshot without loss of historical ledger data.