Skip to content

ATS-COM-CAT-017Retain and review promotion usage: Acceptance Test Set

Markdown

ATS-COM-CAT-017

Retain and review promotion usage: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-CAT-017

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

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

01 Redemption retains terms and establishes usageapitest
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 redemptionapinegativetest
Proves
BR-CAP-COM-CAT-017-02
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
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
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses at COMMIT a line whose discount is not its allocations’ sum, SQLSTATE RHC07, naming the line
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses a second redemption of the promotion on the order, by promotion_redemptions_order_promotion_uq
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 releasedapinegativetest
Proves
BR-CAP-COM-CAT-017-03
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
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses a change of the discount, SQLSTATE RHC04, the row untouched
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#lets an applied redemption be released with its time and reason
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses moving a released redemption back to applied, SQLSTATE RHC04
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 attributionapinegativetest
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
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#records order.promotion_released on the order, with the actor and the reason
Source
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#gives the use back on the code
05 Cancellation release uses retained policyapiproposed
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 recordsapinegativetest
Proves
BR-CAP-COM-CAT-017-06
Preconditions
A redemption references an order, promotion and code
Steps
Attempt to remove those parents
Expected
Each deletion fails
Data
none
Bound to
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)
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses deleting a promotion a redemption names, by promotion_redemptions_promotion_fk (RESTRICT)
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses deleting a code a redemption names, by promotion_redemptions_code_fk (RESTRICT)
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 benefitsapitest
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
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
services-commerce:modules/promotions/tests/integration/services/persistence/promotion-statistics.queries.integration.spec.js#sums the discount given of the applied redemptions only: $5.00 and $3.00, not the released $10.00
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 releaseapinegativetest
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
services-commerce:modules/promotions/tests/e2e/promotions-security.e2e.spec.js#cannot release a redemption, 403 permission_missing
react-console:components/commerce/__tests__/permission-gating.test.tsx#puts Release Use behind releasing a redemption, not applying a code
Source
services-commerce:modules/promotions/tests/e2e/promotions-security.e2e.spec.js#cannot release a redemption, 403 permission_missing

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.