Skip to content

CAP-COM-CAT-018Preview a promotion against a sample cart

Markdown

CAP-COM-CAT-018

Preview a promotion against a sample cart

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

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
Customer customer staff see an identical outcome a purchaser would see.Trying a promotion does not consumes a use or leaves data behind.
Surfaces
consoleapi
Intent sources
services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D-REC-3 (to confirm)

Controls

20 controls apply, from the corpus control catalogue.

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

Permissions

KeyChecked atScope
commerce.promotions.readapitenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Proposed
For tested sample carts, staff preview shares checkout assessment and returns matching line amounts, discounts and explanations.
no proof recorded yet
calculationservicetest
services-commerce:modules/promotions/tests/e2e/promotion-previews.e2e.spec.js#is, line for line and total for total, what the real checkout preview answers
02must prove
Proposed
Preview reads parts and criteria through shared candidate resolution, including selected automatic drafts, but provides no rated shipping charge.
no proof recorded yet
policyserviceobserved
03must prove
Proposed
Staff preview creates no checkout, item, event, evaluation, redemption or reservation and consumes no promotion usage.
no proof recorded yet
invariantservicetest
services-commerce:modules/promotions/tests/e2e/promotion-previews.e2e.spec.js#opens no checkout and writes no item, event, evaluation, redemption, reservation or order
04must prove
Proposed
An explicitly included draft or paused promotion is assessed as active during preview.
no proof recorded yet
policyservicetest
services-commerce:modules/promotions/tests/integration/services/previews/promotion-previews.integration.spec.js#judges a draft as if active only when it is named: $80.00 without, $72.00 with
05
Proposed
Preview without a buyer uses anonymous Standard pricing, accepts an assessment instant and reports totals before shipping and tax.
policyservicetest
services-commerce:modules/promotions/tests/integration/services/previews/promotion-previews.integration.spec.js#judges at the instant asked: a promotion not yet open applies to nothing before it opens and takes 10 % after (the member’s standing, read as of then, has lapsed, so the Standard price)
06must prove
Proposed
Only console callers with promotion-read permission may preview, and empty carts or unsupported fields, policies and included promotions are refused.
no proof recorded yet
permissionapitest

Scenarios

IdGivenWhenThenProvenance
01The guide has an eighty-dollar Member price and a combinable quarter-off codePreview its sample cart as that memberThe pre-tax result is sixty dollars with twenty dollars discountedtest
services-commerce:modules/promotions/tests/e2e/promotion-previews.e2e.spec.js#takes 25 % off the Member price: $80.00 less $20.00 is $60.00

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.