Skip to content

DOM-COM-CAT-005Promotion

Markdown

DOM-COM-CAT-005

Promotion

Markdown
  • DocumentDraft
  • ImplementationPartially observed

Planning

Specified by
CON-COM-CAT-005

Design

Owned by
SVC-COM-CAT-promotions

KindDomain objectProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Relationships

ToCardinalityOwnershipCrosses a serviceOn archive or delete
DOM-COM-CAT-004one promotion to many priced linesPromotions take the audience or Standard amount supplied by pricing as their discount basis.no
DOM-COM-CAT-003many parts to many products and categoriesMerchandise criteria choose products and shelves; excluded products never enter discount assessment.no
DOM-COM-CAT-006one code to many offer rulesRecommendation acceptance can enter the code referenced by its rule on a checkout.no

Invariants

InvariantProtectsEnforced atProvenance
INV-DOM-COM-CAT-005-01
Automatic promotions cannot hold codes; code issuance requires a code-claimed promotion.
servicetest
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
INV-DOM-COM-CAT-005-02
An offer contains either one to twenty parts or a promotion-level benefit, with parts required for percentage and per-unit offers.
api, servicetest
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses parts together with an order-total offer, 400 promotion_invalid in plain words
INV-DOM-COM-CAT-005-03
Promotion names cannot duplicate another workspace name in a different letter case.
service, databasetest
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
INV-DOM-COM-CAT-005-04
The service permits only declared lifecycle moves and records each move in promotion history.
servicetest
services-commerce:modules/promotions/tests/e2e/promotions.e2e.spec.js#refuses every operation from a state it does not move, 409 invalid_transition
INV-DOM-COM-CAT-005-05
First redemption locks the protected economic fields against later edits.
service, databasetest
services-commerce:modules/promotions/tests/e2e/promotion-redemptions.e2e.spec.js#names the column and offers to end the promotion and duplicate it
INV-DOM-COM-CAT-005-06
Normalized code keys cannot duplicate any code in the workspace.
service, databasetest
services-commerce:modules/promotions/tests/e2e/promotion-codes.e2e.spec.js#refuses “EARLY25” beside “early 25”, 409 code_taken
INV-DOM-COM-CAT-005-07
Code dates must remain within the parent promotion’s dates.
servicetest
services-commerce:modules/promotions/tests/e2e/promotion-codes.e2e.spec.js#refuses a window ending after the promotion’s, 400 window_exceeds_promotion
INV-DOM-COM-CAT-005-08
Configured limits cannot fall below the corresponding uses already counted.
service, databasetest
services-commerce:modules/promotions/tests/e2e/promotion-codes.e2e.spec.js#refuses a limit below the uses made, 409 limit_below_uses
INV-DOM-COM-CAT-005-09
A revoked code has no outgoing status change.
servicetest
services-commerce:modules/promotions/tests/e2e/promotion-codes.e2e.spec.js#keeps a revoked code revoked: no operation moves it again
INV-DOM-COM-CAT-005-10
Conditional use updates prevent concurrent placements from exceeding configured capacity.
service, databasetest
INV-DOM-COM-CAT-005-11
An order has at most one redemption per promotion, and committed discount totals equal their line allocations.
databasetest
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
INV-DOM-COM-CAT-005-12
Frozen terms, amounts and allocations cannot be changed, and released uses cannot become applied again.
databasetest
services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses moving a released redemption back to applied, SQLSTATE RHC04
INV-DOM-COM-CAT-005-13
Redemption references retain their promotion, code and order; retirement uses lifecycle controls rather than deletion.
databasetest
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)
INV-DOM-COM-CAT-005-14
A resumed issuance job generates only the codes still missing from its requested count.
servicetest
services-commerce:modules/promotions/tests/unit/issuance/issuance-job.spec.js#continues from the codes that exist after a crash, making only the missing ones

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.