---
id: TST-CRM-REG-057
title: Assignment sources coverage and currency
kind: integration
product_area: crm
module: regions
revision: 1
status: draft
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
repository: services-crm
files:
  - >-
    modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js
implements:
  - ATS-CRM-REG-003-02
  - ATS-CRM-REG-003-03
  - ATS-CRM-REG-006-02
  - ATS-CRM-REG-006-03
  - ATS-CRM-REG-006-05
  - ATS-CRM-REG-008-05
  - ATS-CRM-REG-008-14
  - ATS-CRM-REG-010-02
  - ATS-CRM-REG-010-03
  - ATS-CRM-REG-010-04
  - ATS-CRM-REG-010-05
  - FAS-CRM-REG-04-02
  - FAS-CRM-REG-04-05
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 2
isolation: Suite-owned workspace and records in the prepared test database.
evidence:
  - >-
    services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js
assertions:
  - scenario: ATS-CRM-REG-003-02
    source: >-
      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
  - scenario: ATS-CRM-REG-003-03
    source: >-
      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
  - scenario: ATS-CRM-REG-006-02
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#the
      rest of the world rule › gives an address no other rule matched the rest of the world region
  - scenario: ATS-CRM-REG-006-03
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a
      rule staff turned off › skips the disabled rule and answers the next rule that matches
  - scenario: ATS-CRM-REG-006-03
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a
      rule staff turned off › gives no region when only a disabled rest of the world rule is left,
      because a disabled rule is no answer
  - scenario: ATS-CRM-REG-006-05
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a
      postal code rule confined to a country › matches an address in the country the rule names
  - scenario: ATS-CRM-REG-006-05
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a
      postal code rule confined to a country › refuses the same postal code in another country
  - scenario: ATS-CRM-REG-006-05
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#a
      postal code rule confined to a country › counts an address with no country as US, so a rule
      confined to US matches it
  - scenario: ATS-CRM-REG-008-05
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#an
      organization decided by its preferred address › moves the organization when another of its
      addresses becomes the preferred one
  - scenario: ATS-CRM-REG-008-14
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#tenant
      isolation, with rules on both sides › leaves a contact at that same address unassigned here,
      because the rule that covers it is the neighbour’s
  - scenario: ATS-CRM-REG-008-14
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#tenant
      isolation, with rules on both sides › assigns a contact of the neighbour tenant from the
      neighbour’s own rules
  - scenario: ATS-CRM-REG-010-02
    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
  - scenario: ATS-CRM-REG-010-02
    source: >-
      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
  - scenario: ATS-CRM-REG-010-03
    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
  - scenario: ATS-CRM-REG-010-04
    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
  - scenario: ATS-CRM-REG-010-05
    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
  - scenario: ATS-CRM-REG-010-05
    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
      none is needed while no rule has changed since that run
  - scenario: FAS-CRM-REG-04-02
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#says
      one is still needed, because the run was recorded under the rules as they were before
  - scenario: FAS-CRM-REG-04-05
    source: >-
      services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#says
      one is needed after a rule is added at the very instant the run started
binding_scope: >-
  Exact assertion anchors identify the contribution of this file. Scenario-level bindings may compose
  several files; registration does not assert that every file alone executes every scenario step.
---

# Assignment sources coverage and currency

## Verification Boundary

The suite exercises real regional persistence and processing against the prepared database. It verifies the source assertions linked in this register.

## What This Suite Proves

The linked source assertions contribute checks for assignment can start with empty coverage; record-kind selection limits placement; fallback is deferred and the final enabled fallback wins; disabled coverage contributes no result; postal-country restrictions distinguish otherwise equal codes; configured sources determine reassignment; workspace policies do not leak; a successful current-generation run clears need; policy-affecting writes raise need; changes during processing remain outstanding; equal timestamps do not hide changes; newer policy changes remain outstanding after an older run; coincident timestamps cannot hide a policy change. A scenario spanning several files relies on those assertions together; this file supplies only its named checks.

## What It Does Not Prove

The register establishes neither a current passing run nor verified conformance. Unbound scenarios, broader feature chains and the delegated infrastructure beyond this execution boundary remain unproved.

## Real Dependencies and Test Doubles

PostgreSQL, event capture, dispatch, consumer routing and regional processing are real. The delivery harness replaces the external queue with an in-memory message list.

## Must Not Be Doubled

Regional matching, regional persistence and the stored values under assertion must remain real. A substitute answer for these dependencies cannot qualify the linked regional outcomes.
