Skip to content

CAP-CRM-REG-003Configure automatic placement and its address sources

Markdown

CAP-CRM-REG-003

Configure automatic placement and its address sources

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCRMModuleRegionsRevision2

Read atservices-crm a8d1364freact-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Automatic assignment can be configured before adding coverage.Each record kind has an explicit address source.Invalid settings leave the saved policy intact.
Surfaces
consoleapi
Intent sources
services-crm:docs/migrations/crm-regions/README.md#2026-10-12 — Final acceptance (second pass), Since: 2026-10-14, Andrew: assignment may be on with no rulesservices-crm:docs/migrations/crm-regions/README.md#2026-10-11 second pass (Andrew, 2026-10-11: rules are managed one at a time; an organization has a preferred address)services-crm:docs/migrations/crm-regions/README.md#2026-10-15 — Final acceptance (console follow-ups) (Andrew approved 2026-10-15: two tabs, Test an Address dialog, drawers, a read-only Assignment Rules tab with its own editor screen and the banner)services-crm:docs/milestones/CRM-M1-contacts-and-organizations.md#D-05

Controls

17 controls apply, from the corpus control catalogue.

TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-006 TC-DAT-001 TC-DAT-003 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 TC-TEN-001 TC-TEN-002 TC-TEN-003

Permissions

KeyChecked atScope
crm.regions.readapitenant
crm.regions.updateapitenant

Business Rules

13 rules, 7 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
Without saved settings, automatic assignment is off, contacts use their preferred address, organizations use the seeded Main address type, both kinds are selected and the policy has no rules.
no proof recorded yet
policyservicetest
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
02must prove
Proposed
Automatic assignment can be enabled with an empty policy, whose matching result is no region.
origin: services-crm:docs/migrations/crm-regions/README.md#2026-10-12 — Final acceptance (second pass), Since: 2026-10-14, Andrew: assignment may be on with no rules
no proof recorded yet
policyserviceobserved
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/services/persistence/region-assignment-settings.ts:assignsAutomatically
03must prove
Proposed
The settings select contacts, organizations or both, and automatic placement skips a record kind outside that selection.
no proof recorded yet
policyservicetest
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
04must prove
Proposed
Each record kind uses either its preferred address or a specified address type; the type choice requires a type identifier, and the preferred choice discards one supplied with it.
no proof recorded yet
validationservice, databasetest
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
05must prove
Proposed
A deciding address type must exist in the workspace regardless of its applicability label, and cannot be deleted while the settings reference it.
no proof recorded yet
validationservice, databasetest
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
06
Proposed
Organizations can use a preferred address; omission of their address-source choice means a named type, defaulting to Main if the type is also omitted.
origin: services-crm:docs/migrations/crm-regions/README.md#2026-10-11 second pass (Andrew, 2026-10-11: rules are managed one at a time; an organization has a preferred address)
policyservicetest
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#an organization decided by its preferred address › decides by the address the organization marked preferred, not by its main address
07
Proposed
A settings replacement supplies the automatic-assignment switch and address choices as a whole, with defaults applied to omitted fields.
policyapitest
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#saves the settings, defaulting what the body left out
08must prove
Proposed
Settings replacement rejects a supplied stale version but accepts a request that omits the version.
no proof recorded yet
validationservicetest
09must prove
Proposed
Settings validation reports its collected problems together and commits no changes when validation fails.
no proof recorded yet
validationserviceobserved
10
Proposed
The console asks for an address source only for selected record kinds, filters types by their applicability and retains an already selected type.
policyconsoletest
react-console:components/regions/__tests__/assignment-rules-editor.test.tsx#the settings on the editor › ask for an address only for a kind that is assigned
11
Proposed
The Assignment Rules tab presents saved settings without editing controls; a separate editor and save bar handle changes, and disabled assignment leaves only the summary visible.
origin: services-crm:docs/migrations/crm-regions/README.md#2026-10-15 — Final acceptance (console follow-ups) (Andrew approved 2026-10-15: two tabs, Test an Address dialog, drawers, a read-only Assignment Rules tab with its own editor screen and the banner)
policyconsoletest
react-console:components/regions/__tests__/assignment-rules-view.test.tsx#the Assignment Rules view › is read-only: no switch, no choices, no rule controls and no save bar
12
Proposed
The editor stages and counts changes, Cancel discards the draft and navigation requests confirmation before losing unsaved work.
policyconsoletest
react-console:components/regions/__tests__/assignment-draft.test.ts#the count of unsaved changes › counts the switch and each setting once
13
Proposed
The Regions page preserves its two-tab selection in the URL; without an explicit tab it opens Assignment Rules when assignment is enabled and Regions otherwise.
origin: services-crm:docs/migrations/crm-regions/README.md#2026-10-15 — Final acceptance (console follow-ups) (Andrew approved 2026-10-15: two tabs, Test an Address dialog, drawers, a read-only Assignment Rules tab with its own editor screen and the banner)
policyconsoletest
react-console:components/regions/__tests__/tabs.test.ts#the tab chosen when the URL names none › opens the rules when automatic assignment is on, because the rules then decide where records go

Scenarios

IdGivenWhenThenProvenance
01Member placement uses a preferred address and company placement uses the main office.An administrator enables both kinds with those address sources.Reads return the saved settings while current placements remain unchanged.test
02Contact placement is configured by a named address type.An administrator saves without identifying that type.Validation reports the missing type and commits nothing.test
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

Edge Cases

IdGivenWhenThenProvenance
03Billing is labelled for organizations but selected as the contact source.A client saves the configuration.The service accepts the workspace type even though the console filters it from new contact choices.test
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

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.