Skip to content

ATS-CRM-REG-004Build the geographic assignment policy: Capability Test Specification

Markdown

ATS-CRM-REG-004

Build the geographic assignment policy: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCRMModuleRegionsRevision3

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

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

Test Scenarios

11 scenarios proving CAP-CRM-REG-004; 7 bound to an existing test.

01 Unknown rule kinds are invalidvalidationapinegativetest
Proves
BR-CAP-CRM-REG-004-01
Preconditions
A settings record exists.
Steps
Attempt to store an unsupported rule kind.
Expected
The rule-kind constraint rejects it.
Data
No extra fixture records are required.
Bound to
Source
services-crm:modules/regions/tests/integration/db/region-assignment-settings.table.integration.spec.js#rule constraints › refuses a rule type outside the legacy list
02 Criteria lists require valid bounded contentboundaryapinegativetest
Proves
BR-CAP-CRM-REG-004-02
Preconditions
The workspace contains a target region.
Steps
Submit missing postal ranges, empty states or countries, too many states and a range with a blank endpoint.
Expected
Each invalid list is refused and no replacement policy is committed.
Data
Criteria lists constructed at the required boundary sizes.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 400 for a postal code rule with no ranges
03 Rule normalization removes unrelated criteriaruleapitest
Proves
BR-CAP-CRM-REG-004-03
Preconditions
A target region exists.
Steps
Create a state rule also carrying a country restriction and postal ranges.
Expected
Only the state criteria remain on the saved rule.
Data
A single regional definition.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#drops a country given on a rule that is not a postal code rule, as it drops the other types’ lists
04 Postal restrictions use valid country codesvalidationapinegativetest
Proves
BR-CAP-CRM-REG-004-04
Preconditions
A target region exists.
Steps
Create postal rules with a lowercase two-letter code and an invalid three-letter code.
Expected
The valid code is stored in capitals and the invalid code is refused.
Data
A single regional definition.
Bound to
Source
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 400 for a country that is not an ISO 3166-1 alpha-2 code
05 Foreign and absent rule targets are rejectedboundaryapinegativetest
Proves
BR-CAP-CRM-REG-004-06
Preconditions
Two workspaces contain separate regions.
Steps
Save rules targeting a nonexistent region and the other workspace’s region.
Expected
Both requests identify the missing local target and preserve the saved policy.
Data
Two distinct customer workspaces.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › refuses a rule naming a region the tenant does not have, naming it
06 The policy cannot exceed its rule limitboundaryapinegativeproposed
Proves
BR-CAP-CRM-REG-004-08
Preconditions
The workspace already holds one thousand rules.
Steps
Add one rule and submit a whole list containing one thousand and one rules.
Expected
Both requests are rejected while the existing policy remains intact.
Data
A policy populated to its one-thousand-entry limit.
Source
services-crm:modules/regions/aws/api/regions.schemas.ts:regionAssignmentSettingsSchema; services-crm:modules/regions/services/persistence/region-assignment-settings.ts:createRegionAssignmentRule
07 Omitted rules preserve the listruleapitest
Proves
BR-CAP-CRM-REG-004-09
Preconditions
The settings hold three rules.
Steps
Replace with two different rules, then save settings without a rules property.
Expected
The first replacement establishes the new ordered pair and the second retains it.
Data
A three-entry assignment policy.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › replaces the rules whole on the next save
08 Rule identity and position remain validinvariantapinegativetest
Proves
BR-CAP-CRM-REG-004-10
Preconditions
A target region exists.
Steps
Save three rules, then attempt duplicate positions and a zero position directly.
Expected
The saved rules have identifiers and positions one through three; invalid positions are rejected.
Data
A single regional definition.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-assignment-settings.integration.spec.js#the capability › gives every rule it saved an id of its own, because a rule is a record a console can now manage one at a time
09 Whole-policy replacement changes individual reads and previewinteractionapiproposed
Proves
BR-CAP-CRM-REG-004-09 BR-CAP-CRM-REG-005-03 BR-CAP-CRM-REG-006-01 BR-CAP-CRM-REG-007-01
Preconditions
A policy has two distinguishable overlapping rules and saved assignment choices.
Steps
Save both rules in the opposite order, read each through individual-rule operations and preview an overlapping address.
Expected
Individual reads reflect the saved order and preview identifies the first matching geographic rule.
Data
A policy has two distinguishable overlapping rules and saved assignment choices.
Source
ADR-CRM-REG-006
10 Whole-list save admits an old version-one individual editconcurrencyapinegativeproposed
Proves
BR-CAP-CRM-REG-004-14
Preconditions
A saved rule is read at its initial version and a full-policy draft retains its identifier.
Steps
Change that rule through whole-list replacement, then send the earlier individual replacement at version one.
Expected
The recreated rule starts at version one and the older individual edit passes its version check, exposing the documented concurrency weakness.
Data
A saved rule is read at its initial version and a full-policy draft retains its identifier.
Source
services-crm:modules/regions/services/persistence/region-assignment-settings.ts:saveRegionAssignmentSettings, insertRule, updateRegionAssignmentRule
11 Enabled draft issues prevent submission at the relevant controlsvalidationapiproposed
Proves
BR-CAP-CRM-REG-004-12
Preconditions
A policy editor stages an enabled rule with no target and incomplete criteria plus a typed source with no address type.
Steps
Attempt Save and reveal each reported issue, then disable automatic assignment and review draft issues.
Expected
The enabled draft identifies the affected controls and does not submit; disabling suppresses those editor checks without promising backend acceptance.
Data
A policy editor stages an enabled rule with no target and incomplete criteria plus a typed source with no address type.
Source
react-console:components/regions/__tests__/assignment-draft.test.ts

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.