---
id: TST-CRM-REG-048
title: Assignment-policy database constraints
kind: integration
product_area: crm
module: regions
revision: 1
status: draft
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
repository: services-crm
files:
  - modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js
implements:
  - ATS-CRM-REG-003-04
  - ATS-CRM-REG-003-05
  - ATS-CRM-REG-004-01
  - ATS-CRM-REG-004-02
  - ATS-CRM-REG-004-03
  - ATS-CRM-REG-004-04
  - ATS-CRM-REG-004-05
  - ATS-CRM-REG-004-08
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/db/region-assignment-settings.table.integration.spec.js
assertions:
  - scenario: ATS-CRM-REG-003-04
    source: >-
      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
  - scenario: ATS-CRM-REG-003-04
    source: >-
      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
  - scenario: ATS-CRM-REG-003-05
    source: >-
      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
  - scenario: ATS-CRM-REG-004-01
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses a rule type outside the legacy list
  - scenario: ATS-CRM-REG-004-02
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses a state rule with more than 1000 states
  - scenario: ATS-CRM-REG-004-02
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses a country rule with no countries
  - scenario: ATS-CRM-REG-004-02
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#postal
      code range constraints › refuses a blank start or end
  - scenario: ATS-CRM-REG-004-02
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#postal
      code range constraints › refuses a range position beyond 1000
  - scenario: ATS-CRM-REG-004-03
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses states on a rule that is not a state rule
  - scenario: ATS-CRM-REG-004-04
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses a country that is not two upper-case letters, because it is an ISO 3166-1
      alpha-2 code
  - scenario: ATS-CRM-REG-004-05
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses a rule naming a region of another tenant
  - scenario: ATS-CRM-REG-004-08
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses two rules at one position
  - scenario: ATS-CRM-REG-004-08
    source: >-
      services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule
      constraints › refuses a position below 1
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 database constraints

## 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 typed sources require a type; existence governs service address-type choices; unknown rule kinds are invalid; criteria lists require valid bounded content; rule normalization removes unrelated criteria; postal restrictions use valid country codes; foreign and absent rule targets are rejected; rule identity and position remain valid. 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.
