---
id: TST-CRM-REG-050
title: Assignment-policy persistence and competing writes
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/persistence/region-assignment-settings.integration.spec.js
implements:
  - ATS-CRM-REG-003-01
  - ATS-CRM-REG-003-02
  - ATS-CRM-REG-003-04
  - ATS-CRM-REG-003-05
  - ATS-CRM-REG-003-06
  - ATS-CRM-REG-003-07
  - ATS-CRM-REG-004-02
  - ATS-CRM-REG-004-05
  - ATS-CRM-REG-004-07
  - ATS-CRM-REG-004-08
  - ATS-CRM-REG-005-05
  - FAS-CRM-REG-02-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/persistence/region-assignment-settings.integration.spec.js
assertions:
  - scenario: ATS-CRM-REG-003-01
    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
  - scenario: ATS-CRM-REG-003-02
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › switches assignment on with no rule at all
  - scenario: ATS-CRM-REG-003-04
    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
  - scenario: ATS-CRM-REG-003-04
    source: >-
      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
  - scenario: ATS-CRM-REG-003-05
    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
  - scenario: ATS-CRM-REG-003-05
    source: >-
      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
  - scenario: ATS-CRM-REG-003-05
    source: >-
      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
  - scenario: ATS-CRM-REG-003-06
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses a save from a stale read
  - scenario: ATS-CRM-REG-003-07
    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
  - scenario: ATS-CRM-REG-003-07
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses a state rule with no states
  - scenario: ATS-CRM-REG-004-02
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses a state rule with no states
  - scenario: ATS-CRM-REG-004-05
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › refuses a rule naming a region the tenant does not have, naming it
  - scenario: ATS-CRM-REG-004-07
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › replaces the rules whole on the next save
  - scenario: ATS-CRM-REG-004-08
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the
      capability › gives every rule it saved an id of its own, because a rule is a record a console can
      now manage one at a time
  - scenario: ATS-CRM-REG-005-05
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#rules
      written one at a time, beside a settings save › moves the settings’ version once for each rule
      written, as a settings save does
  - scenario: ATS-CRM-REG-005-05
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#rules
      written one at a time, beside a settings save › a whole-list save read before a rule was created ›
      is refused as stale, so the new rule is not dropped
  - scenario: ATS-CRM-REG-005-05
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#rules
      written one at a time, beside a settings save › a whole-list save read before a rule was created ›
      leaves the rule created beside it in the list
  - scenario: FAS-CRM-REG-02-05
    source: >-
      services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#is
      refused as stale, so the new rule is not dropped
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-policy persistence and competing writes

## 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 unsaved configuration returns defaults; assignment can start with empty coverage; typed sources require a type; existence governs service address-type choices; versionless settings writes bypass conflict checks; collected validation errors preserve the policy; criteria lists require valid bounded content; foreign and absent rule targets are rejected; omitted rules preserve the list; rule identity and position remain valid; individual writes invalidate older policy drafts; individual edits cannot be discarded by an older full draft. 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 and the regional persistence under assertion are real. The suite supplies test execution contexts and fixtures; a local API harness replaces deployed transport where applicable.

## 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.
