Skip to content

ATS-COM-CAT-014Prepare and control a promotion’s lifecycle: Capability Test Specification

Markdown

ATS-COM-CAT-014

Prepare and control a promotion’s lifecycle: 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-068
  • Failure gap: FND-COM-CAT-068
  • Boundary covered
  • Concurrency gap: FND-COM-CAT-068
  • Invariant covered
  • Interaction covered

Test Scenarios

19 scenarios proving CAP-COM-CAT-014; 12 bound to an existing test.

01 Promotion kind changes respect existing codes and lifecyclevalidationapinegativetest
Proves
BR-CAP-COM-CAT-014-01 INV-DOM-COM-CAT-005-01
Preconditions
A coded draft and active automatic promotion exist
Steps
Convert the coded draft, change the active kind and add a code to the automatic promotion
Expected
Each prohibited operation fails
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses to make a draft with a code automatic, 409 automatic_promotion_has_no_codes
02 Offer validation rejects incompatible or excessive partsboundaryunitnegativetest
Proves
BR-CAP-COM-CAT-014-02 BR-CAP-COM-CAT-014-03
Preconditions
A promotion creation request is available
Steps
Combine parts with an order offer, supply twenty-one parts, omit percentage parts, exceed one hundred percent and omit per-unit currency
Expected
Each invalid offer receives a validation refusal
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/promotions/promotion-parts-rules.spec.js#refuses parts together with a promotion-level kind
03 Selling areas validate part targetsvalidationapinegativetest
Proves
BR-CAP-COM-CAT-014-03
Preconditions
The merchandise provider is registered
Steps
Select an unknown area and a nonmerchandise product
Expected
Both part requests identify their invalid target
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses an area nobody offers, 400 promotion_invalid naming the part
04 Promotion validation returns all detected problemsvalidationapinegativetest
Proves
BR-CAP-COM-CAT-014-04
Preconditions
A request contains an invalid cap, interval and currency
Steps
Submit the request once
Expected
One refusal reports every detected issue
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#names every problem of a sloppy promotion in one 400 promotion_invalid, the zero cap among them (Q07, journey 0203)
05 Code and automatic eligibility have different homesvalidationapinegativetest
Proves
BR-CAP-COM-CAT-014-05
Preconditions
Both promotion kinds can be created
Steps
Set promotion eligibility on each and include legacy scope
Expected
Code-promotion eligibility fails, automatic eligibility succeeds and legacy scope has no effect
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses a promotion-level eligibility rule on a code-claimed promotion, 400 in the code’s words
06 Audience combination defaults on and can be changedruleapitest
Proves
BR-CAP-COM-CAT-014-06
Preconditions
A new promotion omits the combination setting
Steps
Create it and replace the setting
Expected
The default is enabled and the replacement is readable
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#defaults "combine with audience prices" to yes when the body leaves it out (D12)
07 Lifecycle transitions validate states and retain reasonstransitionapinegativetest
Proves
BR-CAP-COM-CAT-014-09 AS-JNY-COM-CAT-004-01
Preconditions
Fixtures cover each promotion state
Steps
Exercise valid transitions and unsupported moves
Expected
Valid moves appear in history and invalid moves identify their states
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#pauses an active promotion, resumes a paused one, and activates a paused one
08 Activation requires operational configurationvalidationapinegativetest
Proves
BR-CAP-COM-CAT-014-10
Preconditions
Drafts lack active codes, parts or selected eligibility rules
Steps
Attempt activation of each
Expected
Each refusal identifies its missing prerequisite
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses to activate a coded promotion with no active code, 409 no_active_code
09 Launch authority is independent of preparation authoritypermissionapinegativetest
Proves
BR-CAP-COM-CAT-014-11 AS-JNY-COM-CAT-004-02
Preconditions
Separate callers hold manage and activate permissions
Steps
Attempt preparation, pause, activation and resumption
Expected
Management cannot launch or resume, and activation authority alone cannot pause
Data
Personas by key
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions-security.e2e.spec.js#cannot activate a draft, 403 permission_missing
10 Console actions reflect the separate launch grantpermissionunittest
Proves
BR-CAP-COM-CAT-014-11
Preconditions
Read-only, coordinator and administrator fixtures exist
Steps
Render promotion actions for each
Expected
Coordinators receive preparation and pause actions without Activate or Resume
Data
none
Bound to
Source
react-console:components/commerce/__tests__/permission-gating.test.tsx#lets a coordinator prepare and pause but not launch or resume (commerce.promotions.activate)
11 Used promotions retain economic terms while allowing maintenanceinvariantapinegativetest
Proves
BR-CAP-COM-CAT-014-12 INV-DOM-COM-CAT-005-05
Preconditions
A promotion already has redemptions
Steps
Change its benefit, extend dates, change limits and duplicate after ending
Expected
Locked benefit changes fail; permitted maintenance saves and the duplicate is editable
Data
Planted redemptions
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#refuses the new benefit value, 409 promotion_locked
12 Promotion view reflects a coordinator’s saved editrulebrowsertest
Proves
AS-JNY-COM-CAT-004-03
Preconditions
The browser uses mocked promotions
Steps
Create a category offer, view it and change its benefit to fifteen percent
Expected
The view displays the revised offer
Data
Console mock
Bound to
Source
react-console:e2e/mock/promotions.mock.spec.ts#a new promotion is created for a category, shown on its view, and an edit to 15% comes back to the view
13 Code state changes promotion launch readinessinteractionapiproposed
Proves
BR-CAP-COM-CAT-014-10 BR-CAP-COM-CAT-015-09
Preconditions
A coded draft has one active code.
Steps
Disable its code and attempt launch; enable the code and launch; revoke it and assess a new claim.
Expected
Launch without an active code refuses; launch after enablement succeeds and the revoked claim refuses.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses to activate a coded promotion with no active code, 409 no_active_code,services-commerce:modules/promotions/tests/e2e/promotion-codes.e2e.spec.js#keeps a revoked code revoked: no operation moves it again
14 Promotion lifecycle changes checkout candidatesinteractionapiproposed
Proves
BR-CAP-COM-CAT-014-09 BR-CAP-COM-CAT-014-12 BR-CAP-COM-CAT-016-11
Preconditions
An active automatic promotion matches the cart.
Steps
Preview it, pause and preview again, resume and place; attempt to edit the economic benefit.
Expected
Pause removes the benefit, resume restores it and first use prevents the benefit edit.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses every operation from a state it does not move, 409 invalid_transition,services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#names the column and offers to end the promotion and duplicate it,services-commerce:modules/promotions/tests/unit/pricing/validation.spec.js#answers the first refusal in the order of 10.3: an inactive code before an exhausted one
15 First redemption changes which promotion edits remain possibleinteractionapiproposed
Proves
BR-CAP-COM-CAT-014-12 BR-CAP-COM-CAT-017-01
Preconditions
An unused active promotion is editable.
Steps
Place its first qualifying sale, change its benefit and then change its display name.
Expected
Usage is retained, economic editing refuses and the display-name edit succeeds.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#names the column and offers to end the promotion and duplicate it,services-commerce:modules/promotions/tests/integration/services/persistence/promotion-redemptions.integration.spec.js#locks the promotion at its first redemption
16 Promotion lifecycle is exercised across every declared movetransitionapinegativeproposed
Proves
BR-CAP-COM-CAT-014-09 BR-CAP-COM-CAT-014-10 BR-CAP-COM-CAT-014-11 BR-CAP-COM-CAT-014-12
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-007-promotion-lifecycle.md#STATE-COM-CAT-007,services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses to activate a coded promotion with no active code, 409 no_active_code,services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses every operation from a state it does not move, 409 invalid_transition,services-commerce:modules/promotions/tests/e2e/promotions-security.e2e.spec.js#cannot activate a draft, 403 permission_missing,services-commerce:modules/promotions/services/promotions/promotion-rules.ts:PROMOTION_OPERATIONS,services-commerce:modules/promotions/services/promotions/promotion-rules.ts:PROMOTION_OPERATIONS,services-commerce:modules/promotions/services/persistence/promotions.ts:PROMOTION_TRANSITIONS,services-commerce:modules/promotions/services/persistence/promotions.ts:PROMOTION_TRANSITIONS,services-commerce:modules/promotions/tests/integration/services/persistence/promotion-redemptions.integration.spec.js#locks the promotion at its first redemption
17 Mixed promotion benefit shapes refuse without a draftinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-005-02 BR-CAP-COM-CAT-014-02
Preconditions
An administrator can prepare an automatic promotion.
Steps
Create a promotion with a valid merchandise part and an order-total benefit together; separately try a twenty-first part.
Expected
Both requests refuse and no invalid draft is retained.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses parts together with an order-total offer, 400 promotion_invalid in plain words,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-005-promotion.md#DOM-COM-CAT-005
18 A case-only campaign name collision preserves the first draftinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-005-03 BR-CAP-COM-CAT-014-08
Preconditions
A saved campaign has the name Spring Benefit.
Steps
Create a second campaign named SPRING BENEFIT and reread the first.
Expected
The name conflict refuses and the original draft stays unchanged.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses a name another promotion of the tenant has, whatever its case, 409 promotion_name_taken,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-005-promotion.md#DOM-COM-CAT-005
19 Invalid campaign moves preserve state and historyinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-005-04 BR-CAP-COM-CAT-014-09
Preconditions
Independent campaigns start in draft, active, paused, ended and archived states.
Steps
For each origin, request operations the lifecycle forbids and compare the saved state and history before and after.
Expected
Each refusal identifies the states and no successful move is recorded.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses every operation from a state it does not move, 409 invalid_transition,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-005-promotion.md#DOM-COM-CAT-005

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.