Skip to content

CAP-COM-CAT-017Retain and review promotion usage

Markdown

CAP-COM-CAT-017

Retain and review promotion usage

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Each use is accounted for down to the line it discounted.A use is supplied back exclusively by an authorised person with an attributed reason, or by a cancellation the promotion allows.
Surfaces
consoleapi
Intent sources
services-commerce:docs/milestones/plans/COMM-M1-plan.md#2. Scope (item 6)services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D13services-commerce:docs/milestones/plans/COMM-M1-plan.md#4. Assumptions (A15)services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D-REC-11 (to confirm)

Controls

32 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-CRY-001 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-005 TC-VEN-001 TC-VEN-002 TC-VEN-003 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.promotions.readapitenant
commerce.promotions.overrideapitenant

Business Rules

9 rules, 8 to be proved before approval. A rule's product intent is derived from its origin: 2 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
Order placement records redemption and increments code and promotion usage in the order transaction, freezing redemption terms and locking the promotion on first use.
no proof recorded yet
invariantservicetest
02must prove
Confirmed
Each order redeems a promotion at most once, and commit requires redemption totals and line discounts to agree with their allocations.
origin: COMM-M1 D12 point 6 (docs/milestones/decisions/COMM-M1-D12-andrew-2026-10-19.md)
no proof recorded yet
invariantdatabasetest
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
03must prove
Proposed
Redemption amounts, snapshots and allocations are immutable, and applied status may become released without returning to applied.
no proof recorded yet
invariantdatabasetest
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses moving a released redemption back to applied, SQLSTATE RHC04
04must prove
Confirmed
Override permission and a reason allow one recorded release that restores code and promotion usage and appears in both histories.
origin: COMM-M1 plan A15 (promotions D-06) (docs/milestones/plans/COMM-M1-plan.md)
no proof recorded yet
permissionapi, servicetest
05must prove
Proposed
Full cancellation releases usage only under the redemption’s retained cancellation-release setting; partial cancellation and refund do not restore it.
origin: COMM-M1 D13 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
no proof recorded yet
policyservicedocumented
services-commerce:docs/milestones/plans/COMM-M1-plan.md#D13. Restore a personal code when its order is cancelled?
06must prove
Proposed
Redemption references protect their orders, promotions and codes from deletion and preserve redemption allocations.
no proof recorded yet
invariantdatabasetest
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)
07must prove
Proposed
Performance groups monetary figures by currency and reports usage, remaining capacity, discounts, discounted-line revenue, refunds, credits and latest-checkout rejection reasons, excluding released uses.
no proof recorded yet
calculationservicetest
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
08
Proposed
Promotion, code and order redemption lists show newest uses first with line allocations and order numbers and totals.
origin: COMM-M1 plan scope item 6 (docs/milestones/plans/COMM-M1-plan.md)
policyservice, consoletest
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#lists the promotion’s redemptions newest first, each with its allocation
09must prove
Proposed
Read permission covers redemption and performance inspection, while release requires override permission independently of manage or launch authority.
no proof recorded yet
permissionapi, consoletest
services-commerce:modules/promotions/tests/e2e/promotions-security.e2e.spec.js#cannot release a redemption, 403 permission_missing

Scenarios

IdGivenWhenThenProvenance
01The order has an applied code redemptionRelease with a reason and repeat the requestUsage is restored with both histories recorded, and the second release failstest
02A personal single-use redemption retains enabled cancellation releaseCancel its order fullyThe code becomes available for another usedocumented
services-commerce:docs/milestones/plans/COMM-M1-plan.md#D13. Restore a personal code when its order is cancelled?

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.