Skip to content

CAP-COM-ORD-012Sell through the application that owns the purchase

Markdown

CAP-COM-ORD-012

Sell through the application that owns the purchase

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98macroservice-libraries 54536a44

The Formal Contract

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

Outcomes
Applications can register products for the common Commerce sale process.A plain Accounting product can be sold without external delivery work.
Surfaces
apijob
Intent sources
services-commerce:docs/milestones/plans/COMM-M2-plan.md#D14services-commerce:docs/milestones/plans/COMM-M2-plan.md#Words used in this plan.

Controls

35 controls apply, from the corpus control catalogue.

TC-IAM-006 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-DAT-004 TC-LOG-004 TC-LOG-005 TC-CHG-001 TC-CHG-002 TC-CHG-003 TC-CHG-004 TC-CHG-007 TC-AVL-004 TC-MON-001 TC-MON-002 TC-MON-004 TC-PI-001 TC-PI-002 TC-PI-004 TC-PI-005 TC-VEN-001 TC-VEN-002 TC-VEN-003 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.checkouts.readapitenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Deployment registration validates an application manifest and reconciles its registry, advancing the version on a repeat and retiring or reactivating types as declarations change.
lifecycleservice, databasetest
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#registers the same manifest again as one reconcile: the version moves, nothing else does
02must prove
Confirmed
Registration rejects malformed manifests, unsupported contract versions and missing or non-executable claim functions with the detected problems.
validationservicetest
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a manifest that does not parse, every problem named (400 manifest_invalid)
03must prove
Confirmed
A declared product type cannot belong to two active selling applications.
invariantservice, databasetest
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a product type another active participant sells (the floor is the partial unique index)
04must prove
Confirmed
The application database role reads the participant registry, with writes admitted only through registration.
invariantdatabasetest
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#the application role writing the registry itself: SELECT alone, the function the one way in
05must prove
Confirmed
Application calls include the acting subject and use operation timeouts of five seconds for advice, ten for preparation and sixty otherwise, distinguishing unavailable calls from invalid responses.
policyservicetest
services-commerce:modules/participants/tests/unit/client/lambda-participant-client.spec.js#times out by the contract’s timeout for the operation, aborting the call: advise 5 s, prepare 10 s
06must prove
Confirmed
Contract schemas reject undeclared structural fields in requests and responses, with support for the current major version and its predecessor when a second major exists.
validationservicetest
07must prove
Confirmed
Item details must use a declared schema version and satisfy a published parser, while a remote type without a published parser relies on its version declaration.
validationservicetest
services-commerce:modules/participants/tests/integration/services/registry/table-registry.integration.spec.js#parses a payload through the in-process participant’s schema, refusing an undeclared version and a payload outside it
08must prove
Confirmed
Commerce’s built-in plain-product application accepts empty details for Accounting products, takes no claim, plans one delivery unit and completes that unit without external work.
policyservicetest
services-commerce:modules/participants/tests/unit/plain/plain-product-participant.spec.js#claims nothing for an item: ok, no claim, an attested empty payload and one unit to deliver
09must prove
Confirmed
Readers can discover product types owned by active selling applications and their supported schemas; unsellable and unowned types are excluded.
policyapi, servicetest
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#lists the sellable product types with the participant that sells each, to a reader; not the unsellable one
10must prove
Confirmed
A product type’s declared order kind classifies its sale, with the application identity used when no kind is declared.
calculationservicetest
services-commerce:modules/participants/tests/unit/registration/manifest-contract-versions.spec.js#classifies a sale by the declared order_kind, else by the participant’s id
11must prove
Confirmed
A type can declare up to twenty provisional pricing audiences for purchases that qualify other items in the same order.
policyservicetest
services-commerce:modules/participants/tests/unit/registry/manifest-pricing-policy.spec.js#answers what a line grants: the audiences once each when the switch is on, nothing when off, undeclared, on with no audience, or not a policy
12must prove
Confirmed
Claim calls use a consistent ordering of application, resource and line to reduce competing lock-order conflicts.
invariantservice, databasetest
macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then resource key, then line
13must prove
Confirmed
Placed-line delivery belongs to the fulfilment register, which calls the selling application when the frozen delivery condition opens.
policyservicedocumented

Scenarios

IdGivenWhenThenProvenance
01A certificate fee needs billing but no shipping or application record creation.Staff buy the plain product and meet the order’s payment requirement.The fee follows normal pricing and billing and its built-in delivery completes without external work.documented

Edge Cases

IdGivenWhenThenProvenance
02An application manifest declares a claim function unavailable to the claimer.Register the manifest at deployment.Registration identifies the unusable function and does not activate the declaration.test
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a claim function that does not exist, and one the claimer role cannot execute, each named (400 sql_function_not_executable)

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.