Skip to content

ATS-CRM-REG-007Check an address against the saved policy: Capability Test Specification

Markdown

ATS-CRM-REG-007

Check an address against the saved policy: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-CRM-REG-007

Design

Executed by
TST-CRM-REG-047, TST-CRM-REG-067

KindAcceptance test setProduct areaCRMModuleRegionsRevision3

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

  • Rule covered
  • Transition not-applicable
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure gap: FND-CRM-REG-052
  • Boundary covered
  • Concurrency gap: FND-CRM-REG-052
  • Invariant covered
  • Interaction covered

Test Scenarios

8 scenarios proving CAP-CRM-REG-007; 5 bound to an existing test.

01 Preview explains the winning ruleruleapitest
Proves
BR-CAP-CRM-REG-007-01
Preconditions
Saved postal coverage includes Boston.
Steps
Preview an address within that coverage.
Expected
The answer identifies the region and winning rule with an explanation of its kind and position.
Data
A single policy entry.
Bound to
Source
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
02 Preview leaves policy unchangedinvariantapitest
Proves
BR-CAP-CRM-REG-007-02 AS-JNY-CRM-REG-001-03
Preconditions
A policy is saved.
Steps
Preview an address and read back the policy.
Expected
The read returns the previous saved policy without changes.
Data
Previously persisted geographic coverage.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › writes nothing: the tenant still has the rules it had
03 Preview is read-authorized workpermissionapinegativetest
Proves
BR-CAP-CRM-REG-007-04
Preconditions
One caller has regional read and another has no regional keys.
Steps
Preview the same address as each caller.
Expected
The reader receives a result and the unauthorized caller receives a refusal.
Data
Two identities with distinct authority.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 403 to a context carrying no regions permission at all
04 An address is required for previewvalidationapinegativetest
Proves
BR-CAP-CRM-REG-007-05
Preconditions
Rules have been saved.
Steps
Submit a preview request without its address.
Expected
Validation rejects the request.
Data
No extra fixture records are required.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers 400 for a body with no address
05 Preview explains lack of coverageedgeapitest
Proves
BR-CAP-CRM-REG-007-06
Preconditions
The policy has no fallback.
Steps
Preview an uncovered address.
Expected
The response has neither target nor winning rule and explains the absence of a match.
Data
Previously persisted geographic coverage.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#the preview › answers no region and no rule for an address no rule covers
06 Preview follows saved choices without applying a draftinteractionapiproposed
Proves
BR-CAP-CRM-REG-004-09 BR-CAP-CRM-REG-006-01 BR-CAP-CRM-REG-007-01 BR-CAP-CRM-REG-007-02
Preconditions
The saved policy has an overlap and a later fallback.
Steps
Read the settings, preview a covered address, save a different rule order through policy maintenance, and preview again; compare policy reads before and after each preview.
Expected
Each result explains its winning saved rule and preview itself leaves configuration intact.
Data
The saved policy has an overlap and a later fallback.
Source
ADR-CRM-REG-005
07 Preview stays inside the caller’s saved policyboundaryapiproposed
Proves
BR-CAP-CRM-REG-007-01 INV-DOM-CRM-REG-002-10
Preconditions
Two workspaces save different target rules for the same address.
Steps
Preview that address in each workspace using a caller authorized for both, and inspect each winning rule.
Expected
Each result names only its workspace’s target and rule.
Data
Two workspaces save different target rules for the same address.
Source
services-crm:modules/regions/aws/api/regions.routes.ts:previewRegionAssignment
08 Preview ignores automatic placement eligibilityruleapiproposed
Proves
BR-CAP-CRM-REG-007-07
Preconditions
Saved coverage matches an address while automatic placement is off or limited to one record kind.
Steps
Preview the address under each eligibility setting without changing its coverage.
Expected
Every preview returns the saved matching target independently of the automatic switch and record-kind choice.
Data
Saved coverage matches an address while automatic placement is off or limited to one record kind.
Source
services-crm:modules/regions/services/region-assignment/region-assignment.ts:previewRegionAssignment

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.