ScrymeDeveloper Docs
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 StateisActiveisArchivedPOS VisibilityAccounting Records
ActivetruefalseVisible & sellableLive in stock reports
Disabled (Inactive)falsefalseHidden from POSPreserved in inventory list
ArchivedfalsetrueHidden from POSMoved to vault; historical data preserved
Permanently Deleted——ErasedBlocked if historical sales/batches exist

2. Archiving a Product (Soft Deletion)

When an item is discontinued, archiving ensures fiscal and transaction integrity:

  1. Open the item in the product view at /inventory/products/[id].
  2. In the top sticky header, click the Archive Product button.
  3. The system executes an atomic transaction:
    • Sets isArchived: true and isActive: false on the product.
    • Cascades isActive: false to 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.
  4. The product is relocated to the Archived Items Vault at /inventory/archived.

3. Restoring Archived Items

Archived products can be reactivated at any time:

  1. Navigate to /inventory/archived.
  2. Search or select the item to open its details view.
  3. Click the Unarchive Product button in the top header.
  4. 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.