Skip to content

ATS-COM-CAT-017Retain and review promotion usage: Capability Test Specification

Markdown

ATS-COM-CAT-017

Retain and review promotion usage: 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 gap: FND-COM-CAT-071
  • Permission covered
  • Edge gap: FND-COM-CAT-071
  • Failure gap: FND-COM-CAT-071
  • Boundary gap: FND-COM-CAT-071
  • Concurrency gap: FND-COM-CAT-071
  • Invariant covered
  • Interaction covered

Test Scenarios

12 scenarios proving CAP-COM-CAT-017; 7 bound to an existing test.

01 Redemption retains terms and establishes usageruleapitest
Proves
BR-CAP-COM-CAT-017-01
Preconditions
A code promotion has no previous redemption
Steps
Place a qualifying order
Expected
Usage increments, terms are retained, the promotion locks and history records application
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/integration/services/persistence/promotion-redemptions.integration.spec.js#counts one use on the code and one on the promotion
02 Commit rejects allocation mismatch and duplicate redemptioninvariantapinegativetest
Proves
BR-CAP-COM-CAT-017-02 INV-DOM-COM-CAT-005-11
Preconditions
Order and promotion fixtures support redemption insertion
Steps
Commit mismatched allocations and a second redemption for the same order and promotion
Expected
Both commits fail
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses at COMMIT a redemption whose discount is not its allocations’ sum, naming the redemption
03 Redemption status cannot return from releasedinvariantapinegativetest
Proves
BR-CAP-COM-CAT-017-03 INV-DOM-COM-CAT-005-12
Preconditions
An applied redemption exists
Steps
Change its amount, release it and restore applied status
Expected
The amount and reversal fail while release succeeds
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses a change of the discount, SQLSTATE RHC04, the row untouched
04 Release restores capacity once with attributiontransitionapinegativetest
Proves
BR-CAP-COM-CAT-017-04 AS-JNY-COM-CAT-005-03
Preconditions
A single-use code has been redeemed
Steps
Release with a reason, repeat and omit the reason on another request
Expected
The first restores usage and records both histories; repeat and missing-reason requests fail
Data
Planted order
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#gives the use back on the code
05 Cancellation release uses retained policytransitionapiproposed
Proves
BR-CAP-COM-CAT-017-05
Preconditions
Orders retain enabled and disabled cancellation-release settings
Steps
Fully cancel each, partially cancel another and refund another
Expected
Only full cancellation under the enabled setting restores usage
Data
Orders with cancellations
Source
services-commerce:docs/milestones/plans/COMM-M1-plan.md#D13. Restore a personal code when its order is cancelled?
06 References preserve redeemed parent recordsinvariantapinegativetest
Proves
BR-CAP-COM-CAT-017-06 INV-DOM-COM-CAT-005-13
Preconditions
A redemption references an order, promotion and code
Steps
Attempt to remove those parents
Expected
Each deletion fails
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses deleting an order a redemption was earned on, by promotion_redemptions_order_fk (RESTRICT)
07 Performance sums applied monetary benefitsruleapitest
Proves
BR-CAP-COM-CAT-017-07
Preconditions
Two USD redemptions discount five and three dollars under a hundred-use limit
Steps
Read promotion performance
Expected
The report shows two uses, ninety-eight remaining and eight dollars discounted
Data
Planted redemptions
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#answers the uses, what is left of the limit of 100 and the money of the two uses planted: $5.00 and $3.00 off, in USD
08 Only override authority permits releasepermissionapinegativetest
Proves
BR-CAP-COM-CAT-017-09
Preconditions
Callers separately hold manage, activate and override grants
Steps
Attempt redemption release with each
Expected
Only override succeeds
Data
Personas by key
Bound to
Source
services-commerce:modules/promotions/tests/e2e/promotions-security.e2e.spec.js#cannot release a redemption, 403 permission_missing
09 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
10 Releasing usage restores capacity without erasing termsinteractionapiproposed
Proves
BR-CAP-COM-CAT-015-08 BR-CAP-COM-CAT-015-11 BR-CAP-COM-CAT-017-04 BR-CAP-COM-CAT-017-05
Preconditions
A personal single-use first code has one applied redemption.
Steps
Attempt to lower its limit; release with override and a reason; read counts and frozen allocations.
Expected
The invalid limit change refuses; release restores capacity while retaining the discount evidence.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/e2e/promotion-codes.e2e.spec.js#refuses a limit below the uses made, 409 limit_below_uses,services-commerce:modules/promotions/tests/integration/services/persistence/promotion-codes.integration.spec.js#turns release on cancellation on when the first code is personal and single-use, and says so in the history,services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#refuses a release without a reason, 400,services-commerce:docs/milestones/plans/COMM-M1-plan.md#D13. Restore a personal code when its order is cancelled?
11 Only an applied benefit consumes redemption capacityinteractionapiproposed
Proves
BR-CAP-COM-CAT-016-12 BR-CAP-COM-CAT-016-16 BR-CAP-COM-CAT-017-01 BR-CAP-COM-CAT-017-02
Preconditions
One code loses to a cheaper audience and another wins.
Steps
Place each result and read redemption rows and usage counters.
Expected
Only the winning applied promotion has a redemption and increased counters.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/unit/pricing/apply-promotions.spec.js#refuses a promotion whose benefit is zero on every qualifying line (an amount off a line already free),services-commerce:modules/promotions/tests/integration/services/persistence/redemption-concurrency.integration.spec.js#applies exactly 100 and answers the other 100 code_exhausted,services-commerce:modules/promotions/tests/integration/services/persistence/promotion-redemptions.integration.spec.js#locks the promotion at its first redemption,services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses at COMMIT a redemption whose discount is not its allocations’ sum, naming the redemption
12 Promotion redemption is exercised across every declared movetransitionapinegativeproposed
Proves
BR-CAP-COM-CAT-017-03 BR-CAP-COM-CAT-017-04 BR-CAP-COM-CAT-017-05
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-010-promotion-redemption.md#STATE-COM-CAT-010,services-commerce:modules/promotions/services/redemptions/redemption-release.ts:releaseVoidedOrderRedemptions,services-commerce:modules/promotions/services/redemptions/redemption-release.ts:releaseRedemptionsForCancelledLines,services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#refuses a release without a reason, 400

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.