Skip to content

ATS-CRM-REG-008Keep placements aligned with address changes: Acceptance Test Set

Markdown

ATS-CRM-REG-008

Keep placements aligned with address changes: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-CRM-REG-008

KindAcceptance test setProduct areaCRMModuleRegionsRevision2

Read atservices-crm a8d1364freact-console baf6dae3

Test Scenarios

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

01 Placement is a reaction to committed creationapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#initial assignment › gives a contact created with a matching address that address's region
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers a contact posted through the contacts route with no region: the assignment is a reaction to the save
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#gives that contact its region once the change event has been delivered
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 placementapitest
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
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
services-crm:tests/e2e/dev/regions.dev.spec.ts#moves the contact when its address moves to another region
services-crm:modules/regions/tests/legacy/rolodex-regions/tests/e2e/assign-region.e2e.spec.js#Assign Regions (e2e) › Contacts › should get the contact and check that the region is correct
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 placementapitest
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#moving › clears an organization's region when its main address is removed
services-crm:tests/e2e/dev/regions.dev.spec.ts#clears the region when the address matches no rule
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 placementapitest
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
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
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 reassignmentapitest
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#the deciding address type › decides by the address of the named type, not by an address of another type
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#the deciding address type › decides an organization by the address type the settings name, not by its main address
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#an organization decided by its preferred address › moves the organization when another of its addresses becomes the preferred one
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 regionapitest
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
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)
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 skipsapiproposed
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 deliveryapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#two messages delivered out of order › writes once for the two deliveries, because the second finds the fingerprint the first wrote
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#the same message delivered twice › writes nothing the second time: the fingerprint says the deciding address is the one it decided from
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 loopapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#one delivery of one address change › is not called again by its own write, so an assignment cannot set off another
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 changeapitest
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
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
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 › leaves the last-modified stamp the save wrote
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#a deciding-address change that moves the region › bumps the version exactly once past the save, because the region moved
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#the version an organization’s assignment bumps › leaves an organization at the version its save answered when its region does not change
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#the version an organization’s assignment bumps › bumps it once past the save when the region moves
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 editsapitest
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
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
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) › bumps the contact’s version once, for the region that moved and nothing else
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 placementapiproposed
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 assignmentapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-delivery.integration.spec.js#a delivery that fails and is made again › assigns the region on the next delivery of the same message
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 leakapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment-rules.integration.spec.js#tenant isolation, with rules on both sides › assigns a contact of the neighbour tenant from the neighbour’s own rules
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#tenant isolation › assigns nothing in a tenant with no settings, whatever another tenant's rules say
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

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.