---
id: ATS-CRM-REG-007
scope: CAP-CRM-REG-007
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-007-01
    title: Preview explains the winning rule
    level: api
    proves:
      - BR-CAP-CRM-REG-007-01
    preconditions: Saved postal coverage includes Boston.
    steps: Preview an address within that coverage.
    expected: The answer identifies the region and winning rule with an explanation of its kind and position.
    negative: false
    data_needs: A single policy entry.
    bound_to:
      - TST-CRM-REG-047
    provenance: test
    source: >-
      services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers the region the
      address would be given and the rule that decides it
    category: rule
    test_assertions:
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers the region the
        address would be given and the rule that decides it
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › says why, so the console
        can show it
  - id: ATS-CRM-REG-007-02
    title: Preview leaves policy unchanged
    level: api
    proves:
      - BR-CAP-CRM-REG-007-02
      - AS-JNY-CRM-REG-001-03
    preconditions: A policy is saved.
    steps: Preview an address and read back the policy.
    expected: The read returns the previous saved policy without changes.
    negative: false
    data_needs: Previously persisted geographic coverage.
    bound_to:
      - TST-CRM-REG-047
    provenance: test
    source: >-
      services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › writes nothing: the tenant
      still has the rules it had
    category: invariant
    test_assertions:
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › writes nothing: the
        tenant still has the rules it had
  - id: ATS-CRM-REG-007-03
    title: Preview is read-authorized work
    level: api
    proves:
      - BR-CAP-CRM-REG-007-04
    preconditions: One caller has regional read and another has no regional keys.
    steps: Preview the same address as each caller.
    expected: The reader receives a result and the unauthorized caller receives a refusal.
    negative: true
    data_needs: Two identities with distinct authority.
    bound_to:
      - TST-CRM-REG-047
      - TST-CRM-REG-067
    provenance: test
    source: >-
      services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 403 to a context
      carrying no regions permission at all
    category: permission
    test_assertions:
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 403 to a context
        carrying no regions permission at all
      - >-
        services-crm:tests/unit/regions-authorization.spec.ts#requires crm.regions.read to preview the
        region an address would be assigned, because it writes nothing
  - id: ATS-CRM-REG-007-04
    title: An address is required for preview
    level: api
    proves:
      - BR-CAP-CRM-REG-007-05
    preconditions: Rules have been saved.
    steps: Submit a preview request without its address.
    expected: Validation rejects the request.
    negative: true
    data_needs: No extra fixture records are required.
    bound_to:
      - TST-CRM-REG-047
    provenance: test
    source: >-
      services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 400 for a body
      with no address
    category: validation
    test_assertions:
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 400 for a body
        with no address
  - id: ATS-CRM-REG-007-05
    title: Preview explains lack of coverage
    level: api
    proves:
      - BR-CAP-CRM-REG-007-06
    preconditions: The policy has no fallback.
    steps: Preview an uncovered address.
    expected: The response has neither target nor winning rule and explains the absence of a match.
    negative: false
    data_needs: Previously persisted geographic coverage.
    bound_to:
      - TST-CRM-REG-047
    provenance: test
    source: >-
      services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers no region and no
      rule for an address no rule covers
    category: edge
    test_assertions:
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers no region and no
        rule for an address no rule covers
  - id: ATS-CRM-REG-007-06
    title: Preview follows saved choices without applying a draft
    category: interaction
    level: api
    proves:
      - BR-CAP-CRM-REG-004-09
      - BR-CAP-CRM-REG-006-01
      - BR-CAP-CRM-REG-007-01
      - BR-CAP-CRM-REG-007-02
    preconditions: The saved policy has an overlap and a later fallback.
    steps: >-
      Read the settings, preview a covered address, save a different rule order through policy
      maintenance, and preview again; compare policy reads before and after each preview.
    expected: Each result explains its winning saved rule and preview itself leaves configuration intact.
    negative: false
    data_needs: The saved policy has an overlap and a later fallback.
    bound_to: []
    provenance: proposed
    source: ADR-CRM-REG-005
    exercises:
      - CAP-CRM-REG-004
      - CAP-CRM-REG-006
      - CAP-CRM-REG-007
  - id: ATS-CRM-REG-007-07
    title: Preview stays inside the caller’s saved policy
    category: boundary
    level: api
    proves:
      - BR-CAP-CRM-REG-007-01
      - INV-DOM-CRM-REG-002-10
    preconditions: Two workspaces save different target rules for the same address.
    steps: >-
      Preview that address in each workspace using a caller authorized for both, and inspect each winning
      rule.
    expected: Each result names only its workspace’s target and rule.
    negative: false
    data_needs: Two workspaces save different target rules for the same address.
    bound_to: []
    provenance: proposed
    source: 'services-crm:modules/regions/aws/api/regions.routes.ts:previewRegionAssignment'
  - id: ATS-CRM-REG-007-08
    title: Preview ignores automatic placement eligibility
    category: rule
    level: api
    proves:
      - BR-CAP-CRM-REG-007-07
    preconditions: Saved coverage matches an address while automatic placement is off or limited to one record kind.
    steps: Preview the address under each eligibility setting without changing its coverage.
    expected: >-
      Every preview returns the saved matching target independently of the automatic switch and
      record-kind choice.
    negative: false
    data_needs: Saved coverage matches an address while automatic placement is off or limited to one record kind.
    bound_to: []
    provenance: proposed
    source: >-
      services-crm:modules/regions/services/region-assignment/region-assignment.ts:previewRegionAssignment
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/e2e/regions.e2e.spec.js'
  - 'services-crm:tests/unit/regions-authorization.spec.ts'
coverage:
  rule: covered
  transition: not-applicable
  validation: covered
  permission: covered
  edge: covered
  failure: 'gap: FND-CRM-REG-052'
  boundary: covered
  concurrency: 'gap: FND-CRM-REG-052'
  invariant: covered
  interaction: covered
coverage_notes:
  transition: This capability computes or previews a result and owns no persisted state transition.
---

# Check an address against the saved policy: Capability Test Specification

## Coverage

A covered category has an authored proof; execution and remaining variants are tracked separately.

| Rule | Proved By |
|---|---|
| `BR-CAP-CRM-REG-007-01` | `ATS-CRM-REG-007-01`, `ATS-CRM-REG-007-06`, `ATS-CRM-REG-007-07` |
| `BR-CAP-CRM-REG-007-02` | `ATS-CRM-REG-007-02`, `ATS-CRM-REG-007-06` |
| `BR-CAP-CRM-REG-007-04` | `ATS-CRM-REG-007-03` |
| `BR-CAP-CRM-REG-007-05` | `ATS-CRM-REG-007-04` |
| `BR-CAP-CRM-REG-007-06` | `ATS-CRM-REG-007-05` |
| `BR-CAP-CRM-REG-007-07` | `ATS-CRM-REG-007-08` |

## Interactions With Related Capabilities

Preview follows saved choices without applying a draft. The interaction scenario connects build the geographic assignment policy, determine an address’s geographic region with this capability. Cross-workflow expectations are proposed where no executable binding is present.
