---
id: STATE-COM-CAT-002
title: Store activation
object: DOM-COM-CAT-002
product_area: commerce
module: catalog
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
states:
  - name: active
    meaning: Shopper pages and public quotes can use this store.
  - name: inactive
    meaning: >-
      Shopper lists are empty, product pages are unavailable and public quotes fail; staff receive removal
      diagnostics.
  - name: deleted
    meaning: The record is absent and its default picture awaits cleanup.
transitions:
  - from: active
    to: inactive
    trigger: A store replacement disables activity.
    guard: The store version must match and full protection must be absent.
    side_effects:
      - Shopper visibility excludes this store’s listings.
    who: Store administrator (update permission)
    provenance: observed
    source: 'services-commerce:modules/configuration/services/persistence/stores.ts:updateStore'
  - from: inactive
    to: active
    trigger: A store replacement enables activity.
    guard: Update protection and the store’s current version must permit replacement.
    side_effects: []
    who: Store administrator (update permission)
    provenance: observed
    source: 'services-commerce:modules/configuration/services/persistence/stores.ts'
  - from: active
    to: deleted
    trigger: Staff request store removal.
    guard: Removal requires no protection and no checkout or order reference.
    side_effects:
      - The old default picture becomes eligible for eventual cleanup.
    who: Store administrator (delete permission)
    provenance: test
    source: >-
      services-commerce:modules/catalog/tests/integration/services/assets/catalog-assets.integration.spec.js#detaches
      the store’s picture when the store is deleted
  - from: inactive
    to: deleted
    trigger: Staff request store removal.
    guard: Removal requires no protection and no checkout or order reference.
    side_effects:
      - The old default picture becomes eligible for eventual cleanup.
    who: Store administrator (delete permission)
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/stores.integration.spec.js#refuses
      deleting a store a checkout was opened in, naming the store
invalid:
  - from: deleted
    to: active
    why: Removal has no operation that restores the same record.
concurrency: >-
  Versioned replacements reject stale edits. Each storefront request rereads activity, so the next page
  reflects a committed switch.
invariants:
  - INV-DOM-COM-CAT-002-05
  - INV-DOM-COM-CAT-002-06
  - INV-DOM-COM-CAT-002-07
evidence:
  - >-
    services-commerce at c8b66a98: modules/configuration/services/persistence/stores.ts;
    modules/catalog/services/storefront/storefront-listings.ts (step 1, the store read).
---

# Store activation

## The Lifecycle

```mermaid
stateDiagram-v2
  [*] --> active: created
  active --> inactive: switched off
  inactive --> active: switched on
  active --> deleted: nothing has sold in it
  inactive --> deleted: nothing has sold in it
  deleted --> [*]
```

## Transitions Explained

Active: Shopper pages and public quotes can use this store. Inactive: Shopper lists are empty, product pages are unavailable and public quotes fail; staff receive removal diagnostics. Deleted: The record is absent and its default picture awaits cleanup.

## What Cannot Happen

Removal has no operation that restores the same record.

## Concurrency and Timing

Versioned replacements reject stale edits. Each storefront request rereads activity, so the next page reflects a committed switch.
