Skip to content

CAP-COM-ORD-002Select and preserve the sale’s checkout policy

Markdown

CAP-COM-ORD-002

Select and preserve the sale’s checkout policy

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

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
Staff can explain the currency and business unit selected for a cart.An existing order retains the commercial policy recorded at sale.
Surfaces
consoleapi
Intent sources
services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D9services-commerce:docs/milestones/plans/COMM-M2-plan.md#A6services-commerce:docs/milestones/plans/COMM-M2-plan.md#COMM-M2-X02

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

Permissions

KeyChecked atScope
commerce.checkouts.updateapitenant
commerce.checkouts.createapitenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Policy resolution uses an explicit choice, then the store, the first main item’s selling context, its application default and the workspace default, recording the source of the result.
calculationservicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes the tenant default when the item’s application has no default, source tenant_default: an item without a context resolves by its participant
02must prove
Confirmed
A conflicting policy resolved by a main item prevents both cart creation and later addition, identifies the two policies and stores no conflicting item.
invariantservicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming both, nothing added
03must prove
Confirmed
Items attached to a bundle parent do not determine the cart’s checkout policy.
calculationservicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#ignores a bundled item (one with a parent) when deciding, and decides at a later add
04must prove
Confirmed
Only staff can explicitly switch an open cart to an existing active policy, updating its currency and history; an item that locks the policy prevents the switch.
permissionapi, servicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#lets staff switch it explicitly, the currency following, audited; never a portal member
05must prove
Confirmed
An explicit staff policy choice allows items whose selling contexts would otherwise resolve another policy.
policyservicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes an item of another context under an EXPLICIT profile: staff chose, the items’ own contexts are not held against it
06must prove
Confirmed
An explicitly selected policy rejects a requested currency that differs from its own.
validationapi, servicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the profile named on the create with source explicit, and refuses a currency that is not the profile’s, 400 currency_mismatch
07must prove
Confirmed
Placement stops until a checkout policy can be resolved, and a cart with a policy still fails placement when it contains no items.
validationservicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses placing without a profile, 409 placement_refused with ordering_profile_required, the refusal on the trail; then places once staff name one
08must prove
Confirmed
Placement preserves the selected policy’s identity, version, origin, context and settlement settings on the order, independently of later policy edits.
invariantservice, databasetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#keeps a placed order’s snapshot when the profile is edited afterwards: the profile moves to version 2, the order stays at 1 with its rules (D24)
09must prove
Confirmed
Main item applications determine the order classification: one application supplies its kind, multiple applications produce a mixed order, and no application produces a general order.
calculationservicetest
services-commerce:modules/orders/tests/unit/placement/classify-order.spec.js#classifies an order whose item lines two applications sold as mixed, the kinds in line order
10
Confirmed
Policy-resolution errors use the customer terms checkout policy and workspace.
policyservicetest
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#says checkout policy and workspace, never ordering profile or tenant, when nothing resolves one (COMM-M2 R2-5)

Scenarios

IdGivenWhenThenProvenance
01A conference cart receives a membership renewal with a different policy context.Staff first add the conflicting renewal, then explicitly select the required policy.The conflict blocks the first addition, while the deliberate staff choice permits it.unknown

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.