Skip to content

CAP-COM-CAT-013Calculate and explain a buyer’s item price

Markdown

CAP-COM-CAT-013

Calculate and explain a buyer’s item price

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
A buyer’s price is an identical whether customer staff preview it, a shopper browses it or a checkout charges it.Membership retains its value, and nobody is charged a price a required rule does not approved.
Surfaces
consoleportalapi
Intent sources
services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D5services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D8services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D10services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D14services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D5-F1services-commerce:docs/milestones/plans/COMM-M1-plan.md#2. Scope (item 7)services-commerce:docs/milestones/plans/COMM-M1-plan.md#4. Assumptions (A11, A13, A14)

Controls

26 controls apply, from the corpus control catalogue.

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-TEN-004 TC-CRY-001 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-AVL-005 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-005 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.price-quotes.readapitenant
commerce.orders.createservicetenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Proposed
Pricing follows entered variable amounts, qualification, audience-period selection, application adjustments, quantity adjustments, product pricing, rounding and store order pricing, with promotions and tax applied afterward.
origin: COMM-M1 D5 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
calculationservicetest
services-commerce:modules/pricing/tests/unit/engine/engine.spec.js#prices the hoodies through the member cell, the variant, the bulk rule and the store’s line discount, in that order
02must prove
Proposed
Standard always qualifies, and active eligibility audiences qualify only on an eligible decision for the qualification date; other verdicts retain their reasons without qualification.
calculationservicetest
services-commerce:modules/pricing/tests/unit/engine/step-2-audience-resolution.spec.js#does not qualify for an ineligible decision, an indeterminate one, a provisional one or one under review, and says why
03must prove
Proposed
A missing audience-period price falls back to that audience’s Always price and then another qualifying audience, ultimately Standard.
origin: COMM-M1 D6 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
calculationservice, consoletest
services-commerce:modules/pricing/tests/unit/engine/step-3-base-price.spec.js#inherits the audience’s always cell when the period has none, never another period’s cell
04must prove
Proposed
Each pricing rounding step uses whole minor currency units and moves exact halves away from zero.
origin: COMM-M1 D5 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
calculationservice, consoletest
services-commerce:modules/pricing/tests/unit/engine/rounding.spec.js#rounds a negative half down, away from zero, where Math.round would answer -2
05must prove
Confirmed
Computed foreign-currency prices use the base price and that day’s exchange rate, retain conversion provenance on the line and refuse pricing when the rate is missing.
origin: COMM-M1 plan A14 (MP D-19) (docs/milestones/plans/COMM-M1-plan.md)
calculationservicetest
services-commerce:modules/pricing/tests/unit/engine/step-3-base-price.spec.js#converts a calculate cell from the base cell at the rate of the day, rounded half away from zero, and freezes the conversion
06must prove
Proposed
Standard currency prohibition prevents purchase by every audience in that currency, and products outside their sale windows cannot be priced for purchase.
validationservicetest
services-commerce:modules/pricing/tests/unit/engine/step-3-base-price.spec.js#refuses a currency the product is prohibited in for everyone (a prohibit on standard)
07must prove
Proposed
Public buyers cannot quote drafts, products without listings or products outside the store assortment; console staff with order-create permission receive the exemption.
origin: COMM-M1 D8 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
policyservicetest
services-commerce:modules/pricing/tests/e2e/price-quote-public-sale.e2e.spec.js#prices the draft and the out-of-assortment product for staff holding commerce.orders.create: Standard 6000 and 15000
08must prove
Proposed
Anonymous quotes require a store, exclude person and cart references, and return Standard and publicly displayed audience prices with the sign-in notice.
origin: COMM-M1 D10 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
policyapi, servicetest
services-commerce:modules/pricing/tests/e2e/price-quotes.e2e.spec.js#refuses a body that names a subject, an acting contact, a recipient or a cart: nothing about a person is read anonymously
09must prove
Proposed
Required extension failure prevents placement and records an exception; optional placement failures and quote failures skip the extension with a warning.
origin: COMM-M1 D14 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
policyservicetest
services-commerce:modules/pricing/tests/integration/services/extensions/priced-with-extensions.integration.spec.js#refuses with EXTENSION_UNAVAILABLE naming the extension, and records the exception on the order with the SDK’s status (A24)
10must prove
Proposed
An order-pricing extension fee is refused during preview and placement while invoicing support remains unavailable, without saving the sale.
origin: COMM-M1 D5-F1 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
policyservicedocumented
11must prove
Proposed
Staff may preview hypothetical audiences or dates with assumptions identified in the response, while portal buyers cannot use those overrides.
permissionapi, servicetest
services-commerce:modules/pricing/tests/e2e/price-quote-staff-form.e2e.spec.js#refuses a portal member either property, 403, and prices them without
12must prove
Proposed
Portal quotes cover the buyer’s contact or an organization they may act for; organization purchasing-role results are reported per item without refusing the quote.
permissionservicetest
services-commerce:modules/pricing/tests/e2e/price-quotes.e2e.spec.js#is refused a quote for another contact (403), and gets a public quote when naming nobody
13must prove
Proposed
Quoting creates no records or price commitment, and placement recomputes the payable price.
origin: COMM-M1 plan A13 (order domain D13) (docs/milestones/plans/COMM-M1-plan.md)
invariantservicetest
services-commerce:modules/pricing/tests/unit/engine/quote-tolerance.spec.js#differs with the changes when a price moved, never answering the previewed price
14must prove
Proposed
Placement rechecks eligibility-audience lines in the order transaction, rejects lapsed qualification per line and marks each period’s first sale once.
policyservicetest
services-commerce:modules/pricing/tests/integration/services/placement/audience-settlement.integration.spec.js#refuses the placement for a lapsed member, one audience_lapsed problem per line with the portal sentence, stamping nothing
15must prove
Proposed
Quote requests accept at most fifty items with positive integer quantities and require quote-read permission, included in every built-in role.
validationapitest

Scenarios

IdGivenWhenThenProvenance
01The guide has Standard and Member price rowsQuote for a qualified memberThe response uses the eighty-dollar Member pricedocumented
services-commerce:docs/milestones/plans/COMM-M1-plan.md#D5. The order of the price calculation
02The store’s guide listing is draftRequest an anonymous quotePublic-sale validation refuses the draft and identifies the storetest
services-commerce:modules/pricing/tests/e2e/price-quote-public-sale.e2e.spec.js#refuses a draft product to an anonymous caller: 400 product_not_published, naming the store
03The buyer’s Student term ends before the requested date and Alumni then qualifiesRequest a staff quote for the later dateDated qualification selects Member through Alumni rather than Student pricingtest
services-commerce:modules/pricing/tests/e2e/price-quote-staff-form.e2e.spec.js#reads the student’s standing as of August 2027: the student term ended and the committed Alumni term holds, so Member prices, not Student

Edge Cases

IdGivenWhenThenProvenance
04The mug’s pricing function times outRequest its quoteThe row price remains with an extension warning and cart-context indicationtest
services-commerce:modules/pricing/tests/e2e/price-quotes.e2e.spec.js#marks the mug as needing cart context and warns when its extension times out, the price unchanged

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.