---
id: ATS-CRM-REG-002
scope: CAP-CRM-REG-002
product_area: crm
module: regions
revision: 3
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-CRM-REG-002-01
    title: References block removal
    level: api
    proves:
      - BR-CAP-CRM-REG-002-01
      - AS-JNY-CRM-REG-004-01
    preconditions: 'Separate regions are referenced by a contact, an organization and a rule.'
    steps: Attempt deletion of each referenced region.
    expected: 'Every attempt is refused with its dependency identified, leaving the regions present.'
    negative: true
    data_needs: 'Three regional targets, each with its own reference.'
    bound_to:
      - TST-CRM-REG-049
      - TST-CRM-REG-047
      - TST-CRM-REG-066
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/db/regions.table.integration.spec.js#references ›
      refuses to delete a region a contact is in, naming what uses it
    category: invariant
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/db/regions.table.integration.spec.js#references ›
        refuses to delete a region a contact is in, naming what uses it
      - >-
        services-crm:modules/regions/tests/integration/db/regions.table.integration.spec.js#references ›
        refuses to delete a region an organization is in
      - >-
        services-crm:modules/regions/tests/integration/db/regions.table.integration.spec.js#references ›
        refuses to delete a region an assignment rule names
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 409 to a delete of a region in
        use
      - 'services-crm:tests/e2e/dev/regions.dev.spec.ts#refuses to delete a region in use'
  - id: ATS-CRM-REG-002-02
    title: Unused regions can be removed permanently
    level: api
    proves:
      - BR-CAP-CRM-REG-002-02
    preconditions: A region has no references.
    steps: Delete it and request it again.
    expected: Deletion succeeds and the subsequent read returns not found.
    negative: false
    data_needs: An unreferenced catalogue entry.
    bound_to:
      - TST-CRM-REG-047
      - TST-CRM-REG-054
    provenance: test
    source: 'services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#deletes a region nothing uses'
    category: transition
    test_assertions:
      - 'services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#deletes a region nothing uses'
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#leaves nothing to read after the
        delete: a later GET answers 404
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/regions.integration.spec.js#deletes
        a region nothing uses
  - id: ATS-CRM-REG-002-03
    title: Delete authority is separate from edit authority
    level: browser
    proves:
      - BR-CAP-CRM-REG-002-03
    preconditions: A user can create and update regions but cannot delete them.
    steps: Request removal through the service and inspect the region menu.
    expected: Deletion requires the delete key and the menu supplies no usable Delete action.
    negative: true
    data_needs: An ordinary user-tier identity.
    bound_to:
      - TST-CRM-REG-067
      - TST-CRM-REG-040
    provenance: test
    source: >-
      services-crm:tests/unit/regions-authorization.spec.ts#requires crm.regions.delete to delete a
      region
    category: permission
    test_assertions:
      - >-
        services-crm:tests/unit/regions-authorization.spec.ts#requires crm.regions.delete to delete a
        region
      - >-
        react-console:components/regions/__tests__/regions-row-menu.test.tsx#the Regions row menu › does
        not let somebody who may manage regions but not delete them press Delete
  - id: ATS-CRM-REG-002-04
    title: Ordinary replacement can alter a delete lock
    level: api
    proves:
      - BR-CAP-CRM-REG-002-04
    preconditions: One region has a delete lock and another has a full lock.
    steps: 'Delete the first, replace the second and replace the first without its lock.'
    expected: Deletion and the full-lock update are refused; the ordinary replacement clears the delete lock.
    negative: true
    data_needs: Regional examples with deletion and full locks.
    bound_to: []
    provenance: proposed
    source: 'services-crm:modules/regions/services/persistence/regions.ts:updateRegionRow, deleteRegionRow'
    category: edge
  - id: ATS-CRM-REG-002-05
    title: Deactivation distinguishes referenced targets
    level: api
    proves:
      - BR-CAP-CRM-REG-002-07
    preconditions: Assignment is enabled and the current generation has a successful run.
    steps: Deactivate a target of an enabled rule and read settings; repeat with an unreferenced region.
    expected: >-
      The referenced target raises recalculation need and the unrelated deactivation records no policy
      change.
    negative: false
    data_needs: A pair of regional definitions and one policy entry.
    bound_to: []
    provenance: proposed
    source: FND-CRM-REG-021
    category: transition
  - id: ATS-CRM-REG-002-06
    title: Retired targets remain assignable
    level: browser
    proves:
      - BR-CAP-CRM-REG-002-08
    preconditions: An enabled state rule points to an inactive region.
    steps: Create a contact in that state and allow assignment to run.
    expected: The contact receives the inactive target region.
    negative: false
    data_needs: Address input in New York.
    bound_to:
      - TST-CRM-REG-010
    provenance: test
    source: 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts#CRM-ACC-0361'
    category: rule
    test_assertions:
      - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts#CRM-ACC-0361'
  - id: ATS-CRM-REG-002-07
    title: Retirement affects policy currency without disabling matching
    category: interaction
    level: api
    proves:
      - BR-CAP-CRM-REG-002-07
      - BR-CAP-CRM-REG-002-08
      - BR-CAP-CRM-REG-006-01
      - BR-CAP-CRM-REG-010-03
    preconditions: A region has an enabled rule and a current successful recalculation.
    steps: >-
      Retire the definition through catalogue editing, read policy currency, then preview a matching
      address.
    expected: >-
      The region remains readable, recalculation is outstanding and the enabled rule still supplies the
      retired target.
    negative: false
    data_needs: A region has an enabled rule and a current successful recalculation.
    bound_to: []
    provenance: proposed
    source: WF-CRM-REG-004
    exercises:
      - CAP-CRM-REG-001
      - CAP-CRM-REG-002
      - CAP-CRM-REG-006
      - CAP-CRM-REG-010
  - id: ATS-CRM-REG-002-08
    title: Retired definitions can return to use without another policy stamp
    category: transition
    level: api
    proves:
      - BR-CAP-CRM-REG-002-02
      - BR-CAP-CRM-REG-002-06
      - BR-CAP-CRM-REG-002-07
    preconditions: An unused inactive definition and an active definition referenced by an enabled rule exist.
    steps: >-
      Edit the inactive definition while retaining retirement, reactivate it, retire the referenced
      definition, then clear its dependencies and delete it.
    expected: >-
      Reads show each availability change; reactivation leaves generation unchanged and removal becomes
      possible only after dependencies are gone.
    negative: false
    data_needs: An unused inactive definition and an active definition referenced by an enabled rule exist.
    bound_to: []
    provenance: proposed
    source: STATE-CRM-REG-001
evidence:
  - >-
    services-crm: Examined the pinned regional implementation, its declared constraints and the
    supporting records.
  - 'react-console: Examined the pinned regional configuration surfaces and their available test evidence.'
  - 'services-crm:modules/regions/tests/integration/db/regions.table.integration.spec.js'
  - 'services-crm:modules/regions/tests/e2e/regions.e2e.spec.js'
  - 'services-crm:tests/e2e/dev/regions.dev.spec.ts'
  - 'services-crm:modules/regions/tests/integration/services/persistence/regions.integration.spec.js'
  - 'services-crm:tests/unit/regions-authorization.spec.ts'
  - 'react-console:components/regions/__tests__/regions-row-menu.test.tsx'
  - 'services-crm:modules/regions/services/persistence/regions.ts'
  - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts'
coverage:
  rule: 'gap: FND-CRM-REG-047'
  transition: covered
  validation: 'gap: FND-CRM-REG-047'
  permission: covered
  edge: covered
  failure: 'gap: FND-CRM-REG-047'
  boundary: 'gap: FND-CRM-REG-047'
  concurrency: 'gap: FND-CRM-REG-047'
  invariant: covered
  interaction: covered
---

# Retire regions while preserving their references: Capability Test Specification

## Coverage

Each row links a required rule to its authored proof. A covered category records a specification; executable and remaining variant gaps stay in the finding register.

| Rule | Proved By |
|---|---|
| `BR-CAP-CRM-REG-002-01` | `ATS-CRM-REG-002-01` |
| `BR-CAP-CRM-REG-002-02` | `ATS-CRM-REG-002-02`, `ATS-CRM-REG-002-08` |
| `BR-CAP-CRM-REG-002-03` | `ATS-CRM-REG-002-03` |
| `BR-CAP-CRM-REG-002-04` | `ATS-CRM-REG-002-04` |
| `BR-CAP-CRM-REG-002-05` | No scenario: `FND-CRM-REG-047` |
| `BR-CAP-CRM-REG-002-07` | `ATS-CRM-REG-002-05`, `ATS-CRM-REG-002-07`, `ATS-CRM-REG-002-08` |
| `BR-CAP-CRM-REG-002-08` | `ATS-CRM-REG-002-06`, `ATS-CRM-REG-002-07` |

## Interactions With Related Capabilities

Retirement affects policy currency without disabling matching. The interaction scenario connects maintain the region catalogue, determine an address’s geographic region, identify placements that need recalculation with this capability. Cross-workflow expectations are proposed where no executable binding is present.
