Skip to content

ATS-COM-CAT-001Configure reusable sale-processing policies: Capability Test Specification

Markdown

ATS-COM-CAT-001

Configure reusable sale-processing policies: Capability Test Specification

Markdown
  • DocumentProposed
  • Product intentProposed

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision2

Read atservices-commerce c8b66a98react-console baf6dae3

Coverage

  • Rule covered
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge gap: FND-COM-CAT-055
  • Failure covered
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

17 scenarios proving CAP-COM-CAT-001; 10 bound to an existing test.

01 Policy money fields reject incomplete or unsupported choicesvalidationapinegativetest
Proves
BR-CAP-COM-CAT-001-01 BR-CAP-COM-CAT-001-02 INV-DOM-COM-CAT-001-01
Preconditions
A unit supports USD alone
Steps
Attempt creation without currency and with EUR
Expected
Both requests fail on the relevant field and leave no policy
Data
Accounting business unit with currencies
Bound to
Source
services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#answers 400 to a profile without a business unit or without a currency: the two money facts a profile always has
02 Merchant-account eligibility and connection failure take different pathsfailureunitnegativetest
Proves
BR-CAP-COM-CAT-001-03
Preconditions
Accounting provides account fixtures and an unavailable response
Steps
Submit wrong-unit, inactive, wrong-currency and unknown accounts, then simulate connection failure
Expected
Invalid accounts fail field validation; connection failure permits saving with a logged warning
Data
Fixture Accounting accounts
Bound to
Source
services-commerce:modules/configuration/tests/unit/persistence/ordering-profile-merchant-account.spec.js#is refused 400 merchant_account_not_eligible when the account belongs to another business unit
03 Card-range validation identifies missing or reversed boundsvalidationapinegativetest
Proves
BR-CAP-COM-CAT-001-04 INV-DOM-COM-CAT-001-07
Preconditions
Range-based acceptance is selected
Steps
Omit each bound in turn and reverse their order
Expected
Each invalid range fails with the affected bound identified
Data
none
Bound to
Source
services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#answers 400 to a within_range acceptance without its minimum, naming card_minimum_total_minor, with or without the maximum (0755)
04 Database enforcement rejects unsupported payment windowsboundaryapinegativetest
Proves
BR-CAP-COM-CAT-001-05 INV-DOM-COM-CAT-001-08
Preconditions
A policy row is ready for insertion
Steps
Insert zero-minute and eight-day windows
Expected
Both inserts fail their window constraint
Data
none
Bound to
Source
services-commerce:modules/configuration/tests/integration/db/configuration-records.table.integration.spec.js#refuses a tender window outside one minute to a week, by ordering_profiles_tender_window_minutes_check
05 Policy payment lists reject blanks and duplicatesvalidationunitnegativetest
Proves
BR-CAP-COM-CAT-001-07
Preconditions
Policy requests contain editable payment lists
Steps
Replace with an empty collection option and create with a repeated payment method
Expected
Validation identifies each offending entry
Data
none
Bound to
Source
services-commerce:modules/configuration/tests/unit/api/blank-ordering-profile-ids.spec.js#refuses an empty entry in collection_option_ids on a replacement 400, naming the field
06 Default designation transfers without disappearinginvariantapinegativetest
Proves
BR-CAP-COM-CAT-001-09 INV-DOM-COM-CAT-001-02
Preconditions
The workspace initially has no policies
Steps
Create two policies, designate the second and attempt to clear its default flag
Expected
Creation selects the first; transfer selects only the second; clearing the flag fails
Data
none
Bound to
Source
services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.integration.spec.js#makes a second profile no default, and one stating is_tenant_default the default in place of the first, in one transaction
07 References retain default and store policiestransitionapinegativetest
Proves
BR-CAP-COM-CAT-001-10 BR-CAP-COM-CAT-001-11 INV-DOM-COM-CAT-001-03 INV-DOM-COM-CAT-001-05
Preconditions
Workspace and application defaults and a store policy exist
Steps
Deactivate the application default and delete referenced policies, then remove the store reference
Expected
Default and store refusals identify their dependencies; the unreferenced store policy can be deleted
Data
A store under a policy
Bound to
Source
services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.integration.spec.js#refuses making an application default inactive, 409 profile_is_default naming the application, and deactivates it once no default names it (D31)
08 Stale policy replacement preserves the current recordconcurrencyapinegativetest
Proves
BR-CAP-COM-CAT-001-13
Preconditions
The saved policy has advanced to version two
Steps
Submit the earlier version for replacement
Expected
A conflict preserves version two
Data
none
Bound to
Source
services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#answers 409 to a stale version
09 Policy writes refuse a read-only callerpermissionapinegativetest
Proves
BR-CAP-COM-CAT-001-15
Preconditions
A caller has policy read authority alone
Steps
Attempt policy creation, replacement and removal
Expected
Permission refusals preserve the records
Data
Read-exclusively persona
Bound to
Source
services-commerce:modules/configuration/tests/e2e/configuration-security.e2e.spec.js#is refused the creates, 403 permission_missing
10 Policy summary reflects a saved card-range editrulebrowsertest
Proves
BR-CAP-COM-CAT-001-04 AS-JNY-COM-CAT-001-01
Preconditions
The console runs against Commerce mock data
Steps
Create and view a policy, edit its card range and save
Expected
The returned view summarizes the revised range
Data
Console mock
Bound to
Source
react-console:e2e/mock/commerce-checkout-policies.mock.spec.ts#create a policy, read its summary on the view, edit the card range, save, and see it on the view
11 A placed sale retains the policy values it usedruleapiproposed
Proves
BR-CAP-COM-CAT-001-14
Preconditions
A placed order retains a policy snapshot.
Steps
Read the retained settlement, card, invoice and fee-product values; edit the policy; read the retained values again.
Expected
The retained values match the first read and differ from the edited policy.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.queries.integration.spec.js#snapshotOf freezes the settlement, card, invoicing, fee-product and quote rules an order carries (22 §9), nothing else
12 Policy protection refuses the protected writeinvariantapinegativeproposed
Proves
BR-CAP-COM-CAT-001-16
Preconditions
Separate otherwise editable records use full protection and deletion-only protection.
Steps
Replace and delete the fully protected record, then replace and delete the deletion-only protected record; reread both.
Expected
The full-protection requests refuse; the deletion-only replacement succeeds and removal refuses; refused writes preserve the stored record.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/configuration/services/persistence/ordering-profiles.ts
13 Changing the default changes fallback selectioninteractionapiproposed
Proves
BR-CAP-COM-CAT-001-09 BR-CAP-COM-CAT-002-03
Preconditions
Two active policies and no application default exist.
Steps
Resolve the fallback, transfer the workspace default, resolve again and attempt to disable the selected policy.
Expected
The new policy is selected and cannot be disabled while retained as default.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.integration.spec.js#makes a second profile no default, and one stating is_tenant_default the default in place of the first, in one transaction,services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#resolves a context: the profile it names (explicit), else its application’s default, else the tenant default
14 A store retains its checkout policyinteractionapiproposed
Proves
BR-CAP-COM-CAT-001-11 BR-CAP-COM-CAT-003-01
Preconditions
A store uses an otherwise unreferenced policy.
Steps
Request policy deletion; move the store to another valid policy; repeat deletion.
Expected
The first deletion identifies the store; the second removes the now-unreferenced policy.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#answers 409 naming the store while a store sells under the profile, then 200 once the store is gone,services-commerce:modules/configuration/tests/e2e/stores.e2e.spec.js#answers 400 to an ordering profile the tenant does not have, naming the property
15 Checkout policy activation and default designation is exercised across every declared movetransitionapinegativeproposed
Proves
BR-CAP-COM-CAT-001-09 BR-CAP-COM-CAT-001-10 BR-CAP-COM-CAT-001-11 BR-CAP-COM-CAT-001-13 BR-CAP-COM-CAT-001-16
Preconditions
Independent run-owned records start in each declared origin state; guarded variants omit one required condition at a time.
Steps
For each transition case, establish the origin, apply its trigger with the guard satisfied, read the resulting state and side effects, then repeat on a separate record with a required guard absent.
Expected
Every allowed case reaches its stated destination and retains its declared side effects; failed guards preserve the originating record except for the separately documented partial offer action.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
rhythm-v2-docs:specs/commerce/catalog/design/state-models/STATE-COM-CAT-001-checkout-policy-activation-and-default.md#STATE-COM-CAT-001,services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.integration.spec.js#makes a second profile no default, and one stating is_tenant_default the default in place of the first, in one transaction,services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#removes an application default left out of the document, the tenant default kept when null,services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.integration.spec.js#refuses making an application default inactive, 409 profile_is_default naming the application, and deactivates it once no default names it (D31),services-commerce:modules/configuration/services/persistence/ordering-profiles.ts,services-commerce:modules/configuration/tests/e2e/ordering-profiles.e2e.spec.js#answers 409 naming the store while a store sells under the profile, then 200 once the store is gone,services-commerce:modules/configuration/services/persistence/ordering-profiles.ts
16 Reserved policy identities refuse before savinginvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-001-06 BR-CAP-COM-CAT-001-08
Preconditions
An otherwise valid policy request can supply its own identity.
Steps
Create using each reserved identity in mixed case and with surrounding spaces, then create using a distinct ordinary identity.
Expected
Reserved attempts fail without a record; the distinct ordinary identity can be saved.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/configuration/tests/unit/persistence/ordering-profile-rules.spec.js#refuses a reserved id whatever its case and surrounding spaces,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-001-checkout-policy.md#DOM-COM-CAT-001
17 Policy snapshots keep only the required order settingsinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-001-09 BR-CAP-COM-CAT-001-14
Preconditions
A complete policy includes money, timing, card, invoice and fee-product fields.
Steps
Build the retained policy snapshot, compare its fields with the source values and verify that unrelated display and reference fields are absent.
Expected
The snapshot contains the settlement, card, invoice, fee-product and quote settings and excludes unrelated policy fields.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/configuration/tests/integration/services/persistence/ordering-profiles.queries.integration.spec.js#snapshotOf freezes the settlement, card, invoicing, fee-product and quote rules an order carries (22 §9), nothing else,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-001-checkout-policy.md#DOM-COM-CAT-001

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.