Skip to content

ATS-CRM-REG-008Keep placements aligned with address changes: Capability Test Specification

Markdown

ATS-CRM-REG-008

Keep placements aligned with address changes: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCRMModuleRegionsRevision3

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

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

Test Scenarios

16 scenarios proving CAP-CRM-REG-008; 12 bound to an existing test.

01 Placement is a reaction to committed creationtransitionapitest
Proves
BR-CAP-CRM-REG-008-01 AS-JNY-CRM-REG-001-02
Preconditions
Enabled coverage matches a new contact’s address.
Steps
Create the contact, inspect its response, process the change and read it again.
Expected
The response has no calculated region and the later read has the assigned region.
Data
A contact covered by a single policy entry.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#initial assignment › answers no region from the create itself, because the assignment is a reaction to the committed save
02 Moving the deciding address changes placementtransitionapitest
Proves
BR-CAP-CRM-REG-008-02
Preconditions
A contact and organization currently belong to the first region.
Steps
Move their deciding addresses into the second region’s coverage.
Expected
Both placements move to the second region.
Data
Two regional targets with corresponding coverage.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#moving › moves a contact from region A to region B when its address moves
03 Lost deciding input clears calculated placementtransitionapitest
Proves
BR-CAP-CRM-REG-008-03
Preconditions
Records occupy a region under policy without fallback.
Steps
Remove one deciding address and move another beyond all coverage.
Expected
Both calculated regions clear.
Data
A pair of CRM records.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#moving › clears the region when the deciding address is removed
04 Other address edits preserve placementinvariantapitest
Proves
BR-CAP-CRM-REG-008-04
Preconditions
Contact assignment uses Work addresses.
Steps
Edit a contact’s Home address.
Expected
The regional placement remains unchanged.
Data
A contact with two separate address purposes.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#moving › ignores a change to an address that does not decide the region
05 Configured sources determine reassignmentruleapitest
Proves
BR-CAP-CRM-REG-008-05
Preconditions
Contacts use preferred addresses and organizations use a named type.
Steps
Select another preferred contact address and move the organization’s typed address.
Expected
Each placement follows its configured deciding source.
Data
CRM examples with multiple address details.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#moving › follows the address that became preferred
06 No past address preserves a manual regionedgeapitest
Proves
BR-CAP-CRM-REG-008-06
Preconditions
Automatic placement is enabled.
Steps
Create an addressless contact with a supplied region.
Expected
The manually supplied region remains.
Data
A single regional definition.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#initial assignment › keeps a region the client sends with a contact that has no address (nothing decides it)
07 Locks and deletion cause successful skipsedgeapiproposed
Proves
BR-CAP-CRM-REG-008-07
Preconditions
One contact is fully locked and another is deleted before delivery.
Steps
Process both pending changes.
Expected
Processing succeeds without updating either record.
Data
A pair of contact records.
Source
FND-CRM-REG-022
08 Current state defeats duplicate and reversed deliveryconcurrencyapitest
Proves
BR-CAP-CRM-REG-008-08
Preconditions
A contact has committed two address saves.
Steps
Deliver the later event first, the earlier event afterward and a duplicate event.
Expected
Placement reflects current address state and repeated delivery adds no write.
Data
A single contact record.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#two messages delivered out of order › ends in the region of the address the contact has now, not of the one the older message described
09 Assignment changes do not loopinvariantapitest
Proves
BR-CAP-CRM-REG-008-09
Preconditions
Automatic placement is enabled.
Steps
Save an address, process assignment and inspect its generated change.
Expected
The generated change contains regional fields without addresses and invokes no further assignment.
Data
A single contact record.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#one delivery of one address change › records its own write as a change of the region and the fingerprint, and of no address
10 Version effects depend on placement changeinvariantapitest
Proves
BR-CAP-CRM-REG-008-10
Preconditions
A contact and organization belong to the first region.
Steps
Edit within that region, then move both into the second region.
Expected
The first assignment preserves save stamps; the changed placements each add one version increment.
Data
A pair of CRM records.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#a deciding-address change that leaves the region where it was › bumps no version, so the contact stands at the version its save answered
11 Linked placement follows organization address editsinteractionapitest
Proves
BR-CAP-CRM-REG-008-11 AS-JNY-CRM-REG-005-01
Preconditions
A contact uses an address linked from its employer.
Steps
Move the employer address into new coverage.
Expected
The contact region and version change without writing its address rows.
Data
An organization and a contact with an effective affiliation.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#a linked address (docs/affiliations/README.md §0b.3, the fan-out) › moves the linked contact when its organization’s address moves, though no contact row was written
12 Expiry alone leaves the remembered placementedgeapiproposed
Proves
BR-CAP-CRM-REG-008-12
Preconditions
A linked deciding address uses an affiliation ending tomorrow.
Steps
Pass the end date and perform daily affiliation reconciliation.
Expected
The contact retains its stored region, exposing the expiry-trigger gap.
Data
A dated relationship reaching its end boundary.
Source
services-crm:modules/entities/services/persistence/contacts.ts:readContactRegionAddresses; services-crm:modules/entities/services/affiliations/affiliation-date-reconciliation.ts
13 Redelivery can recover assignmentfailureapitest
Proves
BR-CAP-CRM-REG-008-13
Preconditions
The first delivery encounters a failure.
Steps
Process a failing delivery and a subsequent successful one.
Expected
The failure assigns nothing and the subsequent delivery assigns the expected region.
Data
An injected assignment failure.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#a delivery that fails and is made again › assigned nothing while it was failing
14 Workspace policies do not leakboundaryapitest
Proves
BR-CAP-CRM-REG-008-14
Preconditions
Two workspaces have different policies and a third has no settings.
Steps
Create equally addressed contacts in all three.
Expected
Each configured workspace uses its own rules and the third leaves placement unchanged.
Data
Three separate customer workspaces.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#tenant isolation, with rules on both sides › leaves a contact at that same address unassigned here, because the rule that covers it is the neighbour’s
15 Placement combines source selection matching and exceptionsinteractionapiproposed
Proves
BR-CAP-CRM-REG-003-04 BR-CAP-CRM-REG-008-05 BR-CAP-CRM-REG-009-01 BR-CAP-CRM-REG-009-03 BR-CAP-CRM-REG-011-06
Preconditions
Two regions cover the home and work addresses of a contact with both addresses.
Steps
Select work as the deciding source, deliver a work move, hold a manual region, move work again and recalculate; release the hold and deliver the override reaction.
Expected
Unheld placement follows the selected source and matching coverage; the held value survives address processing and recalculation, and release evaluates changed input.
Data
Two regions cover the home and work addresses of a contact with both addresses.
Source
WF-CRM-REG-001
16 Update locks exclude placement writes without requiring retriesinvariantapiproposed
Proves
INV-DOM-CRM-REG-003-06 BR-CAP-CRM-REG-008-07
Preconditions
An eligible contact and organization carry full update locks while their deciding addresses match saved rules.
Steps
Deliver assignment and force recalculation, then read placement, version and remembered input.
Expected
Locked targets are skipped successfully and processing commits no regional write on them.
Data
An eligible contact and organization carry full update locks while their deciding addresses match saved rules.
Source
services-crm:modules/regions/services/region-assignment/region-assignment.ts:reconcileRegionAssignments

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.