---
id: ATS-CRM-REG-010
scope: CAP-CRM-REG-010
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-010-01
    title: Policy saves preserve existing placements
    level: api
    proves:
      - BR-CAP-CRM-REG-010-01
      - AS-JNY-CRM-REG-001-01
    preconditions: Records were placed under an enabled older policy.
    steps: Save coverage that would choose different regions and read the records.
    expected: Their regions remain as previously stored.
    negative: false
    data_needs: Contact records with existing regional values.
    bound_to:
      - TST-CRM-REG-058
      - TST-CRM-REG-066
      - TST-CRM-REG-006
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#rule
      changes and the recalculation › changes no record when the rules are saved
    category: invariant
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#rule
        changes and the recalculation › changes no record when the rules are saved
      - 'services-crm:tests/e2e/dev/regions.dev.spec.ts#changes no contact when the rules are saved'
      - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0357.spec.ts#CRM-ACC-0357'
  - id: ATS-CRM-REG-010-02
    title: A successful current-generation run clears need
    level: api
    proves:
      - BR-CAP-CRM-REG-010-02
    preconditions: Automatic placement is enabled.
    steps: 'Save rules, read settings, recalculate and read settings again.'
    expected: >-
      Recalculation is needed after saving and no longer needed after successful current-policy
      processing.
    negative: false
    data_needs: A single policy entry.
    bound_to:
      - TST-CRM-REG-057
      - TST-CRM-REG-051
      - TST-CRM-REG-045
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
      a recalculation is needed › says a recalculation is needed once the rules have been saved and
      nothing has recalculated
    category: transition
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
        a recalculation is needed › says a recalculation is needed once the rules have been saved and
        nothing has recalculated
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
        a recalculation is needed › says none is needed once a recalculation has succeeded against those
        rules
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js#the
        settings of a tenant that saved them › says a recalculation is needed, because the rules changed
        and none has run since
      - >-
        react-console:e2e/dev/regions.dev.spec.ts#asks for a recalculation after a rule changes, and
        stops asking once it has run
  - id: ATS-CRM-REG-010-03
    title: Policy-affecting writes raise need
    level: api
    proves:
      - BR-CAP-CRM-REG-010-03
    preconditions: A successful run covers the current policy.
    steps: 'Add a rule, recalculate and deactivate an enabled rule’s target.'
    expected: The rule write and relevant deactivation each raise the need signal.
    negative: false
    data_needs: A single policy entry.
    bound_to:
      - TST-CRM-REG-057
      - TST-CRM-REG-010
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
      a recalculation is needed › says one is needed again as soon as a rule is added
    category: transition
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
        a recalculation is needed › says one is needed again as soon as a rule is added
      - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts#CRM-ACC-0361'
  - id: ATS-CRM-REG-010-04
    title: Changes during processing remain outstanding
    level: api
    proves:
      - BR-CAP-CRM-REG-010-04
    preconditions: A recalculation is running.
    steps: 'Add a rule, finish the run and inspect settings.'
    expected: The settings still request recalculation.
    negative: false
    data_needs: Record volume exceeding one processing batch.
    bound_to:
      - TST-CRM-REG-057
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
      a recalculation is needed › a rule saved while a recalculation is under way › says one is still
      needed, because the run was recorded under the rules as they were before
    category: concurrency
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
        a recalculation is needed › a rule saved while a recalculation is under way › says one is still
        needed, because the run was recorded under the rules as they were before
  - id: ATS-CRM-REG-010-05
    title: Equal timestamps do not hide changes
    level: api
    proves:
      - BR-CAP-CRM-REG-010-05
    preconditions: A completed run establishes a successful generation.
    steps: Add a rule with a timestamp equal to that run’s start.
    expected: The generation comparison still requests recalculation.
    negative: false
    data_needs: A fixed clock for coincident timestamps.
    bound_to:
      - TST-CRM-REG-057
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
      a recalculation is needed › a rule change stamped at the very instant the last run started › says
      one is needed after a rule is added at the very instant the run started
    category: boundary
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
        a recalculation is needed › a rule change stamped at the very instant the last run started › says
        one is needed after a rule is added at the very instant the run started
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#whether
        a recalculation is needed › a rule change stamped at the very instant the last run started › says
        none is needed while no rule has changed since that run
  - id: ATS-CRM-REG-010-06
    title: Disabled or absent settings suppress need
    level: api
    proves:
      - BR-CAP-CRM-REG-010-06
    preconditions: One workspace has no settings and another has disabled assignment.
    steps: Read both settings records.
    expected: Neither reports recalculation needed.
    negative: false
    data_needs: Two distinct customer workspaces.
    bound_to:
      - TST-CRM-REG-051
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js#a
      tenant that has saved no settings › says no recalculation is needed, because a tenant with no
      settings assigns nothing to recalculate
    category: edge
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js#a
        tenant that has saved no settings › says no recalculation is needed, because a tenant with no
        settings assigns nothing to recalculate
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js#settings
        saved a second time › says no recalculation is needed, because the tenant assigns nothing
        automatically any more
  - id: ATS-CRM-REG-010-07
    title: An unchanged save still raises need
    level: api
    proves:
      - BR-CAP-CRM-REG-010-08
    preconditions: A successful run covers the current policy.
    steps: Save an identical settings replacement.
    expected: The change counter advances and recalculation becomes needed.
    negative: false
    data_needs: An existing assignment configuration.
    bound_to: []
    provenance: proposed
    source: >-
      services-crm:modules/regions/services/persistence/region-assignment-settings.ts:saveRegionAssignmentSettings
    category: edge
  - id: ATS-CRM-REG-010-08
    title: Currency follows accepted policy changes and successful run coverage
    category: interaction
    level: api
    proves:
      - BR-CAP-CRM-REG-010-02
      - BR-CAP-CRM-REG-010-03
      - BR-CAP-CRM-REG-011-05
      - BR-CAP-CRM-REG-012-01
    preconditions: A saved policy has a completed run for its current generation.
    steps: >-
      Edit settings, then one rule, and retire an enabled target; inspect need after each change, run
      recalculation and read the completed run and settings.
    expected: >-
      Each policy-affecting change raises need; only successful coverage of the current generation clears
      it.
    negative: false
    data_needs: A saved policy has a completed run for its current generation.
    bound_to: []
    provenance: proposed
    source: WF-CRM-REG-003
    exercises:
      - CAP-CRM-REG-002
      - CAP-CRM-REG-003
      - CAP-CRM-REG-004
      - CAP-CRM-REG-005
      - CAP-CRM-REG-010
      - CAP-CRM-REG-011
      - CAP-CRM-REG-012
  - id: ATS-CRM-REG-010-09
    title: Accepted unchanged saves still leave coverage outstanding
    category: invariant
    level: api
    proves:
      - BR-CAP-CRM-REG-010-08
      - INV-DOM-CRM-REG-002-08
    preconditions: An enabled policy has a completed current-generation run.
    steps: >-
      Save identical settings with the current settings version, then read need and completed-run
      coverage.
    expected: The accepted save advances generation and reports another recalculation needed.
    negative: false
    data_needs: An enabled policy has a completed current-generation run.
    bound_to: []
    provenance: proposed
    source: >-
      services-crm:modules/regions/services/persistence/region-assignment-settings.ts:saveRegionAssignmentSettings
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/services/region-assignment/region-assignment.integration.spec.js
  - 'services-crm:tests/e2e/dev/regions.dev.spec.ts'
  - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0357.spec.ts'
  - >-
    services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js
  - >-
    services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js
  - 'react-console:e2e/dev/regions.dev.spec.ts'
  - 'react-console:acceptance/crm/playwright/journeys/configuration/CRM-ACC-0361.spec.ts'
  - 'services-crm:modules/regions/services/persistence/region-assignment-settings.ts'
coverage:
  rule: 'gap: FND-CRM-REG-055'
  transition: covered
  validation: 'gap: FND-CRM-REG-055'
  permission: 'gap: FND-CRM-REG-055'
  edge: covered
  failure: 'gap: FND-CRM-REG-055'
  boundary: covered
  concurrency: covered
  invariant: covered
  interaction: covered
---

# Identify placements that need recalculation: 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-010-01` | `ATS-CRM-REG-010-01` |
| `BR-CAP-CRM-REG-010-02` | `ATS-CRM-REG-010-02`, `ATS-CRM-REG-010-08` |
| `BR-CAP-CRM-REG-010-03` | `ATS-CRM-REG-010-03`, `ATS-CRM-REG-010-08` |
| `BR-CAP-CRM-REG-010-04` | `ATS-CRM-REG-010-04` |
| `BR-CAP-CRM-REG-010-05` | `ATS-CRM-REG-010-05` |
| `BR-CAP-CRM-REG-010-06` | `ATS-CRM-REG-010-06` |
| `BR-CAP-CRM-REG-010-08` | `ATS-CRM-REG-010-07`, `ATS-CRM-REG-010-09` |

## Interactions With Related Capabilities

Currency follows accepted policy changes and successful run coverage. The interaction scenario connects retire regions while preserving their references, configure automatic placement and its address sources, build the geographic assignment policy, maintain individual rules alongside the shared policy, apply the current policy across existing records with this capability. Cross-workflow expectations are proposed where no executable binding is present.
