Skip to content

ATS-CRM-REG-011Apply the current policy across existing records: Capability Test Specification

Markdown

ATS-CRM-REG-011

Apply the current policy across existing records: 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-056
  • Permission covered
  • Edge gap: FND-CRM-REG-056
  • Failure gap: FND-CRM-REG-056
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

11 scenarios proving CAP-CRM-REG-011; 9 bound to an existing test.

01 Start authority uses the admin-tier keypermissionunitnegativetest
Proves
BR-CAP-CRM-REG-011-01
Preconditions
The regional permission catalogue is published.
Steps
Inspect the start requirement and its published tier.
Expected
Starting uses the administrator-tier recalculation permission.
Data
Published operation-access metadata.
Bound to
Source
services-crm:tests/unit/regions-authorization.spec.ts#requires crm.regions.recalculate to start a recalculation
02 Repeated starts return one active runconcurrencyapitest
Proves
BR-CAP-CRM-REG-011-02
Preconditions
The workspace has a running recalculation.
Steps
Request another start twice.
Expected
The requests return the existing run and create no additional run record.
Data
Record volume requiring continuation.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#a recalculation resumed in batches › answers the running run to a second request instead of starting another
03 Request processing and continuation share the runtransitionapitest
Proves
BR-CAP-CRM-REG-011-03
Preconditions
One workspace is small and another needs multiple batches.
Steps
Start work in each with the relevant processing budget.
Expected
The small run can complete in the request; unfinished work remains running and requests continuation.
Data
Two distinct customer workspaces.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#rule changes and the recalculation › finishes a small tenant within the request
04 Continuation resumes committed progresstransitionapitest
Proves
BR-CAP-CRM-REG-011-04
Preconditions
A run has committed its first batch.
Steps
Continue processing until completion.
Expected
The committed traversal advances without repeating already traversed records.
Data
A population beyond the batch boundary.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#a recalculation resumed in batches › continues from its cursor, never repeating a record
05 Recalculation applies changed coverageruleapitest
Proves
BR-CAP-CRM-REG-011-05 AS-JNY-CRM-REG-002-01
Preconditions
Saved rules now point to different targets.
Steps
Run recalculation.
Expected
Eligible contacts and organizations receive the new targets.
Data
CRM records with prior regional placements.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#rule changes and the recalculation › moves a contact to its region under the new rules
06 Held and never-addressed records remaininvariantapitest
Proves
BR-CAP-CRM-REG-011-06 AS-JNY-CRM-REG-002-02
Preconditions
One contact is overridden and another has a manual region with no past deciding address.
Steps
Recalculate the policy.
Expected
Both preserve their existing regions.
Data
A pair of contact records.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#rule changes and the recalculation › leaves a contact that overrides automatic assignment
07 Identical-policy repetition changes no placementinvariantapitest
Proves
BR-CAP-CRM-REG-011-07 AS-JNY-CRM-REG-002-03
Preconditions
The preceding recalculation completed successfully.
Steps
Start a further run without changing inputs.
Expected
A new run is recorded without changing record placements.
Data
CRM records with prior regional placements.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#rule changes and the recalculation › starts a new run when asked again after the first finished
08 Concurrent address editing convergesconcurrencyapitest
Proves
BR-CAP-CRM-REG-011-08
Preconditions
Recalculation is processing a contact.
Steps
Commit a new contact address during its batch.
Expected
Eventual placement corresponds to the newest address.
Data
A contact selected during the concurrent batch.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-assignment.integration.spec.js#a save racing a recalculation › ends with the region of the newest address
09 Counters distinguish traversal from placement changesruleapitest
Proves
BR-CAP-CRM-REG-011-10
Preconditions
Five records are traversed and two placements change.
Steps
Finish recalculation and inspect the result.
Expected
Examined includes all traversed records and changed counts the two placement changes.
Data
Five traversed CRM records.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-recalculations.queries.integration.spec.js#the record a batch of the run answers › answers the whole record of the run the following batches finished, counting every record it walked
10 Recalculation preserves exceptions and reports its coverageinteractionapiproposed
Proves
BR-CAP-CRM-REG-011-01 BR-CAP-CRM-REG-011-05 BR-CAP-CRM-REG-011-06 BR-CAP-CRM-REG-010-02 BR-CAP-CRM-REG-012-01
Preconditions
An enabled policy changes the target for existing addressed contacts and organizations; one contact has a hold.
Steps
Check authority, start a small-batch run, read progress, finish it and read both placement and policy currency.
Expected
Authorized traversal moves eligible placements, retains the held contact and exposes completion; currency clears only for coverage of current policy.
Data
An enabled policy changes the target for existing addressed contacts and organizations; one contact has a hold.
Source
WF-CRM-REG-003
11 Traversal handles empty exact and overflow batch sizesboundaryapiproposed
Proves
BR-CAP-CRM-REG-011-04 BR-CAP-CRM-REG-011-10 INV-DOM-CRM-REG-004-04
Preconditions
Separate workspaces have zero, exactly one batch and one more than a batch of eligible records in each kind.
Steps
Run with a fixed small batch size and inspect every phase change, cursor and final count.
Expected
Each record is examined once, exact-size phases use a later short batch to advance, and both phases finish without omission.
Data
Separate workspaces have zero, exactly one batch and one more than a batch of eligible records in each kind.
Source
services-crm:modules/regions/services/region-assignment/region-recalculation.ts:recalculateBatch

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.