---
id: ATS-CRM-REG-003
scope: CAP-CRM-REG-003
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-003-01
    title: Unsaved configuration returns defaults
    level: api
    proves:
      - BR-CAP-CRM-REG-003-01
    preconditions: The workspace has never saved regional settings.
    steps: Request the assignment settings.
    expected: >-
      Assignment is disabled, both kinds are selected, preferred and Main sources apply, and no policy or
      recalculation need exists.
    negative: false
    data_needs: A workspace without prior regional configuration.
    bound_to:
      - TST-CRM-REG-050
      - TST-CRM-REG-047
      - TST-CRM-REG-051
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › answers assignment off, the legacy defaults and no rules for a tenant that saved none
    category: edge
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › answers assignment off, the legacy defaults and no rules for a tenant that saved
        none
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers assignment off and no rules
        before the tenant saves any
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js#a
        tenant that has saved no settings › answers assignment off, the legacy defaults and no rules,
        with no system properties at all
  - id: ATS-CRM-REG-003-02
    title: Assignment can start with empty coverage
    level: api
    proves:
      - BR-CAP-CRM-REG-003-02
    preconditions: The workspace has no rules.
    steps: Enable assignment with an empty list and create an addressed contact.
    expected: The saved switch is on but the contact receives no region.
    negative: false
    data_needs: A single contact record.
    bound_to:
      - TST-CRM-REG-047
      - TST-CRM-REG-050
      - TST-CRM-REG-057
    provenance: test
    source: >-
      services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#switches assignment on with an empty
      rule list, and reads back on with no rules
    category: edge
    test_assertions:
      - >-
        services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#switches assignment on with an empty
        rule list, and reads back on with no rules
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › switches assignment on with no rule at all
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#assignment
        on with no rule at all › gives the contact no region, because the tenant has no enabled rule to
        match
  - id: ATS-CRM-REG-003-03
    title: Record-kind selection limits placement
    level: api
    proves:
      - BR-CAP-CRM-REG-003-03
    preconditions: Only organizations participate and coverage includes the test address.
    steps: Create a contact and an organization using that address.
    expected: The organization is placed and the contact is skipped.
    negative: false
    data_needs: A policy entry with contact and organization examples.
    bound_to:
      - TST-CRM-REG-058
      - TST-CRM-REG-057
      - TST-CRM-REG-063
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#assignment
      switched off › gives a contact created while only organizations are assigned no region
    category: rule
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#assignment
        switched off › gives a contact created while only organizations are assigned no region
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#assignment
        switched off › still assigns organizations
      - >-
        services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#assignment
        for contacts only › leaves the organization unassigned, though its address is the one the contact
        was assigned from
      - >-
        services-crm:modules/regions/tests/legacy/rolodex-regions/tests/unit/logic/assign-region.unit.spec.js#Address
        Region › Assign Region › should do nothing if assignment is disabled for contacts
  - id: ATS-CRM-REG-003-04
    title: Typed sources require a type
    level: api
    proves:
      - BR-CAP-CRM-REG-003-04
    preconditions: Workspace address types are available.
    steps: 'Save a typed contact source without a type, then a preferred source with a type supplied.'
    expected: The missing type fails validation and the preferred source discards the supplied type.
    negative: true
    data_needs: Baseline address-purpose definitions.
    bound_to:
      - TST-CRM-REG-050
      - TST-CRM-REG-048
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses the type setting with no contact address type id
    category: validation
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › refuses the type setting with no contact address type id
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › drops the contact address type id unless the type is `type`, as the console did with
        the other address type
      - >-
        services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#settings
        constraints › refuses deciding by a type with no address type named
      - >-
        services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#settings
        constraints › refuses an address type named while deciding by the preferred address
  - id: ATS-CRM-REG-003-05
    title: Existence governs service address-type choices
    level: api
    proves:
      - BR-CAP-CRM-REG-003-05
    preconditions: Billing exists but is labelled for organizations.
    steps: 'Save an unknown contact source type, then select Billing for contacts.'
    expected: The unknown type is refused against its field and the existing Billing type is accepted.
    negative: true
    data_needs: Baseline address-purpose definitions.
    bound_to:
      - TST-CRM-REG-050
      - TST-CRM-REG-048
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses a contact address type id the tenant has no address type for
    category: boundary
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › refuses a contact address type id the tenant has no address type for
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › refuses an organization address type the tenant has no address type for
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › takes a contact address type marked for organizations, applies_to being a guide and
        not a rule
      - >-
        services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#settings
        constraints › refuses a contact address type the tenant does not have
  - id: ATS-CRM-REG-003-06
    title: Versionless settings writes bypass conflict checks
    level: api
    proves:
      - BR-CAP-CRM-REG-003-08
    preconditions: Settings currently have version three.
    steps: 'Submit version two, then omit the version.'
    expected: The older version conflicts and the versionless replacement is accepted.
    negative: true
    data_needs: An existing assignment configuration.
    bound_to:
      - TST-CRM-REG-050
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses a save from a stale read
    category: concurrency
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › refuses a save from a stale read
  - id: ATS-CRM-REG-003-07
    title: Collected validation errors preserve the policy
    level: api
    proves:
      - BR-CAP-CRM-REG-003-09
    preconditions: Settings retain two valid rules.
    steps: Submit an empty state criterion and a missing required address type together.
    expected: The refusal identifies both validation problems and the existing rules survive.
    negative: true
    data_needs: A policy retaining two entries.
    bound_to:
      - TST-CRM-REG-050
    provenance: test
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › leaves the saved rules as they were when a save is refused
    category: failure
    test_assertions:
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › leaves the saved rules as they were when a save is refused
      - >-
        services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
        capability › refuses a state rule with no states
  - id: ATS-CRM-REG-003-08
    title: Changed address choices wait for explicit bulk application
    category: interaction
    level: api
    proves:
      - BR-CAP-CRM-REG-003-04
      - BR-CAP-CRM-REG-004-09
      - BR-CAP-CRM-REG-008-05
      - BR-CAP-CRM-REG-010-01
    preconditions: An enabled policy places contacts by their preferred addresses and already has a successful run.
    steps: >-
      Save a typed source and its full coverage; inspect an existing contact and the need signal, then
      edit that contact’s newly deciding address and deliver its reaction.
    expected: >-
      Saving preserves the earlier placement and raises need; the later address reaction uses the saved
      source and coverage.
    negative: false
    data_needs: An enabled policy places contacts by their preferred addresses and already has a successful run.
    bound_to: []
    provenance: proposed
    source: WF-CRM-REG-004
    exercises:
      - CAP-CRM-REG-003
      - CAP-CRM-REG-004
      - CAP-CRM-REG-008
      - CAP-CRM-REG-010
  - id: ATS-CRM-REG-003-09
    title: Assignment can pause and resume with retained coverage
    category: transition
    level: api
    proves:
      - BR-CAP-CRM-REG-003-07
      - BR-CAP-CRM-REG-010-06
      - BR-CAP-CRM-REG-010-03
    preconditions: An enabled current policy has saved rules.
    steps: >-
      Disable assignment, edit retained coverage, inspect currency, then enable assignment and inspect
      the same ordered rules.
    expected: >-
      Disabled configuration retains coverage and suppresses need; reenabling requests recalculation
      under the changed policy.
    negative: false
    data_needs: An enabled current policy has saved rules.
    bound_to: []
    provenance: proposed
    source: STATE-CRM-REG-002
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/persistence/region-assignment-settings.integration.spec.js
  - 'services-crm:modules/regions/tests/e2e/regions.e2e.spec.js'
  - >-
    services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.queries.integration.spec.js
  - >-
    services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js
  - >-
    services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js
  - 'services-crm:modules/regions/tests/legacy/rolodex-regions/tests/unit/logic/assign-region.unit.spec.js'
  - >-
    services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js
coverage:
  rule: covered
  transition: covered
  validation: covered
  permission: 'gap: FND-CRM-REG-048'
  edge: covered
  failure: covered
  boundary: covered
  concurrency: covered
  invariant: 'gap: FND-CRM-REG-048'
  interaction: covered
---

# Configure automatic placement and its address sources: 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-003-01` | `ATS-CRM-REG-003-01` |
| `BR-CAP-CRM-REG-003-02` | `ATS-CRM-REG-003-02` |
| `BR-CAP-CRM-REG-003-03` | `ATS-CRM-REG-003-03` |
| `BR-CAP-CRM-REG-003-04` | `ATS-CRM-REG-003-04`, `ATS-CRM-REG-003-08` |
| `BR-CAP-CRM-REG-003-05` | `ATS-CRM-REG-003-05` |
| `BR-CAP-CRM-REG-003-08` | `ATS-CRM-REG-003-06` |
| `BR-CAP-CRM-REG-003-09` | `ATS-CRM-REG-003-07` |

## Interactions With Related Capabilities

Changed address choices wait for explicit bulk application. The interaction scenario connects build the geographic assignment policy, keep placements aligned with address changes, identify placements that need recalculation with this capability. Cross-workflow expectations are proposed where no executable binding is present.
