---
id: ATS-CRM-REG-002
scope: CAP-CRM-REG-002
product_area: crm
module: regions
revision: 2
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:
      - >-
        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'
    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
  - 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:
      - '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
    provenance: test
    source: 'services-crm:modules/regions/tests/e2e/regions.e2e.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:
      - '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
    provenance: test
    source: 'services-crm:tests/unit/regions-authorization.spec.ts#requires crm.regions.delete to delete a region'
  - id: ATS-CRM-REG-002-04
    title: Ordinary replacement can alter a delete lock
    level: api
    proves:
      - BR-CAP-CRM-REG-002-04
      - BR-CAP-CRM-REG-002-05
    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'
  - 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
  - id: ATS-CRM-REG-002-06
    title: Disabled 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:
      - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts#CRM-ACC-0361'
    provenance: test
    source: 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts#CRM-ACC-0361'
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'
---

# Retire regions while preserving their references: Acceptance Test Set

## Coverage

| 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` |
| `BR-CAP-CRM-REG-002-03` | `ATS-CRM-REG-002-03` |
| `BR-CAP-CRM-REG-002-04` | `ATS-CRM-REG-002-04`; see `FND-CRM-REG-002`, `FND-CRM-REG-012` |
| `BR-CAP-CRM-REG-002-05` | `ATS-CRM-REG-002-04`; see `FND-CRM-REG-002` |
| `BR-CAP-CRM-REG-002-07` | `ATS-CRM-REG-002-05`; see `FND-CRM-REG-001`, `FND-CRM-REG-012` |
| `BR-CAP-CRM-REG-002-08` | `ATS-CRM-REG-002-06`; see `FND-CRM-REG-001` |
