Skip to content

ATS-COM-ORD-012Sell through the application that owns the purchase: Capability Test Specification

Markdown

ATS-COM-ORD-012

Sell through the application that owns the purchase: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision2

Read atservices-commerce c8b66a98macroservice-libraries 54536a44react-console baf6dae3

Coverage

  • Rule covered
  • Transition gap: FND-COM-ORD-069
  • Validation covered
  • Permission gap: FND-COM-ORD-069
  • Edge gap: FND-COM-ORD-069
  • Failure covered
  • Boundary covered
  • Concurrency gap: FND-COM-ORD-069
  • Invariant gap: FND-COM-ORD-069
  • Interaction covered

Test Scenarios

15 scenarios proving CAP-COM-ORD-012; 12 bound to an existing test.

01 Repeated registration reconciles declared typestransitionapitest
Proves
BR-CAP-COM-ORD-012-01
Preconditions
An application already owns declared product types.
Steps
[ { "do": "Register the same manifest, omit a type and declare it again.", "provenance": "test", "source": "services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#answers the contract’s declare response: the active types, nothing deactivated, the instant" } ]
Expected
Its version advances, the omitted type retires and the redeclared type reactivates.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#answers the contract’s declare response: the active types, nothing deactivated, the instant
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
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#retires a product type and a schema version no longer declared, naming the type, and updates a changed declaration
Source
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#answers the contract’s declare response: the active types, nothing deactivated, the instant
02 Invalid registration describes its detected problemsvalidationapinegativetest
Proves
BR-CAP-COM-ORD-012-02
Preconditions
Manifests contain malformed structure, unsupported version and unusable claim function cases.
Steps
[ { "do": "Attempt registration for each.", "provenance": "test", "source": "services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a manifest that does not parse, every problem named (400 manifest_invalid)" } ]
Expected
The result refuses activation with manifest, version or function-specific information.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a manifest that does not parse, every problem named (400 manifest_invalid)
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)
Source
services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a manifest that does not parse, every problem named (400 manifest_invalid)
03 An active type cannot acquire a competing ownerinvariantapinegativetest
Proves
BR-CAP-COM-ORD-012-03
Preconditions
An active application owns a product type.
Steps
[ { "do": "Register another application declaring that type.", "provenance": "test", "source": "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)" } ]
Expected
Registration refuses the conflict without adding the competing registry record.
Data
Use the controlled records and transports established by the cited tests.
Bound to
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)
Source
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)
04 Application invocation respects its contract deadlinefailureunittest
Proves
BR-CAP-COM-ORD-012-05
Preconditions
A remote transport can delay, fail or return an invalid answer.
Steps
[ { "do": "Call advice, preparation and delivery through the contract client.", "provenance": "test", "source": "services-commerce:modules/participants/tests/unit/client/lambda-participant-client.spec.js#invokes the declared ARN synchronously with the wire envelope, the caller carrying the subject, and answers the parsed response" } ]
Expected
Advice and preparation use their five- and ten-second deadlines and failures distinguish unavailable from out-of-contract results.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/participants/tests/unit/client/lambda-participant-client.spec.js#invokes the declared ARN synchronously with the wire envelope, the caller carrying the subject, and answers the parsed response
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
services-commerce:modules/participants/tests/unit/client/lambda-participant-client.spec.js#reports an answer that is not JSON, or that the response schema refuses, as out of contract
Source
services-commerce:modules/participants/tests/unit/client/lambda-participant-client.spec.js#invokes the declared ARN synchronously with the wire envelope, the caller carrying the subject, and answers the parsed response
05 Contract boundaries reject extra structureboundaryunittest
Proves
BR-CAP-COM-ORD-012-06
Preconditions
Envelope fixtures include an extra structural field and version variants.
Steps
[ { "do": "Parse the envelope and evaluate supported versions.", "provenance": "test", "source": "macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#refuses an extra key" } ]
Expected
The extra field fails parsing and version support follows the current and previous-major policy.
Data
Use the controlled records and transports established by the cited tests.
Bound to
macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#supports the current major alone at version 1, and the previous one from version 2
Source
macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#refuses an extra key
06 Payload validation uses the declared versionvalidationapitest
Proves
BR-CAP-COM-ORD-012-07
Preconditions
One in-process type publishes a parser and a remote fixture publishes none.
Steps
[ { "do": "Parse undeclared versions, malformed details and declared remote details.", "provenance": "test", "source": "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" } ]
Expected
The first two fail with schema problems while the remote declared version is accepted without a local parser.
Data
Use the controlled records and transports established by the cited tests.
Bound to
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
services-commerce:modules/participants/tests/integration/services/registry/table-registry.integration.spec.js#accepts a remote participant’s payload as the object it is when no schema is published, after the version check
Source
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
07 Plain-product purchase needs no outside deliveryinteractionapitest
Proves
BR-CAP-COM-ORD-012-08
Preconditions
A certificate-fee Accounting product costs twenty-five dollars.
Steps
[ { "do": "Preview, place on console terms and process its delivery obligation.", "provenance": "test", "source": "services-commerce:modules/participants/tests/unit/plain/plain-product-participant.spec.js#is a built-in participant of every process, and owns the Accounting Product type in the registry" } ]
Expected
The fixture sale bills and accepts, opens its condition and completes through the built-in plain application.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/participants/tests/unit/plain/plain-product-participant.spec.js#is a built-in participant of every process, and owns the Accounting Product type in the registry
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
services-commerce:modules/participants/tests/unit/plain/plain-product-participant.spec.js#refuses a payload that says something, invalid, naming the path
services-commerce:modules/orders/tests/e2e/plain-product.e2e.spec.js#delivers the line at once when the worker runs: the obligation is completed with the participant’s record
Source
services-commerce:modules/participants/tests/unit/plain/plain-product-participant.spec.js#is a built-in participant of every process, and owns the Accounting Product type in the registry
08 Claim sorting produces one deterministic sequenceinvariantunittest
Proves
BR-CAP-COM-ORD-012-12
Preconditions
Invocations span applications, resources and line references.
Steps
[ { "do": "Sort them and compare equal entries.", "provenance": "test", "source": "macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then resource key, then line" } ]
Expected
The result orders application, resource and line consistently, with equal entries comparing equal.
Data
Use the controlled records and transports established by the cited tests.
Bound to
macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then resource key, then line
macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#compares two equal invocations as equal and leaves the input alone
Source
macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then resource key, then line
09 Ordinary application writes cannot alter the selling registryinvariantapitest
Proves
BR-CAP-COM-ORD-012-04
Preconditions
The application role can read a registered type.
Steps
[ { "do": "Attempt direct writes and then use the registration boundary.", "provenance": "test", "source": "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" } ]
Expected
Direct writes are refused and registration remains the permitted write boundary.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
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
Source
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
10 Readers discover only sellable registered typespermissionapitest
Proves
BR-CAP-COM-ORD-012-09
Preconditions
The fixture registry includes sellable and unsellable types.
Steps
[ { "do": "List types with reader authority and then without context.", "provenance": "test", "source": "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" } ]
Expected
The reader sees the sellable owner declarations; the context-free call is refused.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
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
Source
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
11 A declared classification overrides the application fallbackruleunittest
Proves
BR-CAP-COM-ORD-012-10
Preconditions
One declaration names an order kind and another omits it.
Steps
[ { "do": "Classify purchases of each type.", "provenance": "test", "source": "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" } ]
Expected
The first uses its declared kind and the second uses its application identity.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
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
Source
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
12 Pricing audience declarations stop at twenty entriesboundaryunittest
Proves
BR-CAP-COM-ORD-012-11
Preconditions
A manifest enables provisional pricing audiences.
Steps
[ { "do": "Parse twenty distinct audiences and then twenty-one; resolve the enabled policy.", "provenance": "test", "source": "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" } ]
Expected
Twenty is accepted, twenty-one is refused and repeated audience entries produce one granted audience.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
services-commerce:modules/participants/tests/unit/registry/manifest-pricing-policy.spec.js#refuses an empty audience id and more than twenty audiences
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
Source
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
13 Unavailable application advice leaves shopping recoverableinteractionapiproposed
Proves
BR-CAP-COM-ORD-003-03 BR-CAP-COM-ORD-012-05
Preconditions
The owning application stops answering advice.
Steps
[ { "do": "Preview and place, restore the application and preview again.", "provenance": "proposed", "source": [ "services-commerce:modules/checkout/tests/e2e/participant-unavailable.e2e.spec.js#refuses the preview 503 participant_unavailable, retryable", "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" ] } ]
Expected
The unavailable calls produce no sale, and the same cart receives advice after recovery.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/checkout/tests/e2e/participant-unavailable.e2e.spec.js#refuses the preview 503 participant_unavailable, retryable,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
14 Application claim order remains stable during placementinteractionapiproposed
Proves
BR-CAP-COM-ORD-005-06 BR-CAP-COM-ORD-012-12
Preconditions
A cart draws resources from two applications in opposing item order.
Steps
[ { "do": "Race it against a second cart with the same resources and inspect claim calls.", "provenance": "proposed", "source": [ "services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#lets exactly one placement win and refuses the other 409 claim_conflict naming the item and the resource", "macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then resource key, then line" ] } ]
Expected
Calls follow the canonical claim sequence and any losing sale retains no partial claims.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#lets exactly one placement win and refuses the other 409 claim_conflict naming the item and the resource,macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then resource key, then line
15 Grant delivery uses the specification frozen by the selling applicationinteractionapiproposed
Proves
BR-CAP-COM-ORD-012-13 BR-CAP-COM-ORD-013-01
Preconditions
A purchased line freezes a two-use download specification.
Steps
[ { "do": "Change the live product to a different allowance, then run grant delivery.", "provenance": "proposed", "source": [ "services-commerce:docs/milestones/plans/COMM-M2-plan.md#A3", "services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#delivered the obligation to the register: completed, with the grant as its record" ] } ]
Expected
The delivered right has the original two-use allowance.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:docs/milestones/plans/COMM-M2-plan.md#A3,services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#delivered the obligation to the register: completed, with the grant as its record

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.