Skip to content

CAP-CRM-REG-007Check an address against the saved policy

Markdown

CAP-CRM-REG-007

Check an address against the saved policy

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
Staff can inspect the saved policy’s region, winning rule and explanation.
Surfaces
consoleapi
Intent sources
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)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)

Controls

16 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-002 TC-DAT-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PRV-001 TC-PRV-002 TC-TEN-001 TC-TEN-002 TC-TEN-003

Permissions

KeyChecked atScope
crm.regions.readapitenant

Business Rules

9 rules, 6 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
Address preview returns the region, winning rule and explanation supplied by the saved policy.
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)
no proof recorded yet
calculationservicetest
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers the region the address would be given and the rule that decides it
02must prove
Proposed
Preview commits no writes.
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)
no proof recorded yet
invariantservicetest
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › writes nothing: the tenant still has the rules it had
03
Proposed
Preview, automatic assignment and recalculation use the same geographic matcher.
invariantserviceobserved
04must prove
Proposed
Preview requires regional read authority and rejects callers without regional permissions.
no proof recorded yet
permissionapitest
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 403 to a context carrying no regions permission at all
05must prove
Proposed
Preview rejects a request without an address and ignores supplied fields that its geographic criteria do not compare.
no proof recorded yet
validationapitest
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 400 for a body with no address
06must prove
Proposed
An unmatched address returns neither region nor winning rule, together with an explanation.
no proof recorded yet
calculationservicetest
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers no region and no rule for an address no rule covers
07must prove
Proposed
Preview evaluates the saved rules independently of the assignment switch and the selected record kinds.
no proof recorded yet
calculationserviceinferred
08
Proposed
With rules available, the console offers a preview dialog that identifies the region and winning position, labels inactive targets and highlights the winning rule on return.
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__/test-address-dialog.test.tsx#a match › names the region, and the rule that won it in its place in the order
09
Proposed
A rejected preview displays the service explanation as an alert and removes any earlier result.
policyconsoletest
react-console:components/regions/__tests__/test-address-dialog.test.tsx#a refusal › shows what the service said, as an alert

Scenarios

IdGivenWhenThenProvenance
01Saved rules include Boston postal coverage and a fallback.Staff preview a Boston address.The result identifies Northeast and its first postal rule, which the view highlights.test

Edge Cases

IdGivenWhenThenProvenance
02The saved winning rule targets an inactive region.Staff inspect its preview result.The dialog identifies the target as inactive.test
react-console:components/regions/__tests__/test-address-dialog.test.tsx#a match › says so when the region a record would land in is inactive

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.