---
id: ATS-COM-ORD-012
scope: CAP-COM-ORD-012
product_area: commerce
module: orders
revision: 2
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-COM-ORD-012-01
    title: Repeated registration reconciles declared types
    level: api
    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.'
    negative: false
    data_needs: 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
      - >-
        services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#brings
        a retired product type back active when declared again
      - TST-COM-ORD-146
    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
    category: transition
    expected_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-02
    title: Invalid registration describes its detected problems
    level: api
    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.'
    negative: true
    data_needs: 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
        manifest in a contract version Commerce does not support
      - >-
        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)
      - TST-COM-ORD-146
    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)
    category: validation
    expected_provenance: test
    expected_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)
  - id: ATS-COM-ORD-012-03
    title: An active type cannot acquire a competing owner
    level: api
    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.
    negative: true
    data_needs: 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)
      - TST-COM-ORD-146
    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)
    category: invariant
    expected_provenance: test
    expected_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)
  - id: ATS-COM-ORD-012-04
    title: Application invocation respects its contract deadline
    level: unit
    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.
    negative: false
    data_needs: 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
        SDK failure and a FunctionError as unavailable
      - >-
        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
      - TST-COM-ORD-149
    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
    category: failure
    expected_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-05
    title: Contract boundaries reject extra structure
    level: unit
    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.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - 'macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#refuses an extra key'
      - >-
        macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#supports the current major
        alone at version 1, and the previous one from version 2
      - TST-COM-ORD-002
    provenance: test
    source: 'macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#refuses an extra key'
    category: boundary
    expected_provenance: test
    expected_source: 'macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#refuses an extra key'
  - id: ATS-COM-ORD-012-06
    title: Payload validation uses the declared version
    level: api
    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.
    negative: false
    data_needs: 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
      - TST-COM-ORD-148
    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
    category: validation
    expected_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-07
    title: Plain-product purchase needs no outside delivery
    level: api
    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.
    negative: false
    data_needs: 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
      - TST-COM-ORD-150
      - TST-COM-ORD-082
    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
    category: interaction
    expected_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-08
    title: Claim sorting produces one deterministic sequence
    level: unit
    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.'
    negative: false
    data_needs: 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
      - TST-COM-ORD-001
    provenance: test
    source: >-
      macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then
      resource key, then line
    category: invariant
    expected_provenance: test
    expected_source: >-
      macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by participant, then
      resource key, then line
  - id: ATS-COM-ORD-012-09
    title: Ordinary application writes cannot alter the selling registry
    category: invariant
    level: api
    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.
    negative: false
    data_needs: 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
      - TST-COM-ORD-146
    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_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-10
    title: Readers discover only sellable registered types
    category: permission
    level: api
    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.
    negative: false
    data_needs: 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
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#refuses the catalog without
        a context, 401
      - TST-COM-ORD-029
    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_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-11
    title: A declared classification overrides the application fallback
    category: rule
    level: unit
    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.
    negative: false
    data_needs: 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
      - TST-COM-ORD-152
    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_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-12
    title: Pricing audience declarations stop at twenty entries
    category: boundary
    level: unit
    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.'
    negative: false
    data_needs: 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
      - TST-COM-ORD-154
    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_provenance: test
    expected_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
  - id: ATS-COM-ORD-012-13
    title: Unavailable application advice leaves shopping recoverable
    category: interaction
    level: api
    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.'
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    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
    exercises:
      - CAP-COM-ORD-012
      - CAP-COM-ORD-003
    related_capabilities:
      - CAP-COM-ORD-003
    expected_provenance: proposed
    expected_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
  - id: ATS-COM-ORD-012-14
    title: Application claim order remains stable during placement
    category: interaction
    level: api
    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.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    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
    exercises:
      - CAP-COM-ORD-012
      - CAP-COM-ORD-005
    related_capabilities:
      - CAP-COM-ORD-005
    expected_provenance: proposed
    expected_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
  - id: ATS-COM-ORD-012-15
    title: Grant delivery uses the specification frozen by the selling application
    category: interaction
    level: api
    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.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    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
    exercises:
      - CAP-COM-ORD-012
      - CAP-COM-ORD-013
    related_capabilities:
      - CAP-COM-ORD-013
    expected_provenance: proposed
    expected_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
evidence:
  - >-
    Examined reference: macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#compares two
    equal invocations as equal and leaves the input alone
  - >-
    Examined reference: macroservice-libraries:packages/commerce-contracts/src/claims.spec.ts#orders by
    participant, then resource key, then line
  - >-
    Examined reference: macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#refuses an
    extra key
  - >-
    Examined reference: macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts#supports the
    current major alone at version 1, and the previous one from version 2
  - >-
    Examined reference: 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
  - >-
    Examined reference:
    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)
  - >-
    Examined reference:
    services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a
    manifest in a contract version Commerce does not support
  - >-
    Examined reference:
    services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#a
    manifest that does not parse, every problem named (400 manifest_invalid)
  - >-
    Examined reference:
    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)
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    services-commerce:modules/participants/tests/integration/services/persistence/participants.integration.spec.js#brings
    a retired product type back active when declared again
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    services-commerce:modules/participants/tests/unit/client/lambda-participant-client.spec.js#reports an SDK
    failure and a FunctionError as unavailable
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    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
  - >-
    Examined reference:
    services-commerce:modules/participants/tests/unit/plain/plain-product-participant.spec.js#refuses a
    payload that says something, invalid, naming the path
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
coverage_definition: Covered means a design scenario exists; executable coverage and execution results are separate.
permission_coverage:
  - key: commerce.checkouts.read
    where_checked: api
    scenarios: []
    gap: FND-COM-ORD-069
    note: >-
      The listed examples do not establish a complete allow-and-deny matrix for this key; unused catalogue
      keys need no invented route.
    provenance: unknown
    source: FND-COM-ORD-069
transition_coverage:
  - state_model: STATE-COM-ORD-007
    from: unregistered
    to: active
    trigger: A deploy manifest first declares the product type.
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/services/registration/register-participant.ts'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-007
    from: active
    to: retired
    trigger: The owning application later omits this type.
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/services/persistence/participants.ts:registerParticipant'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-007
    from: retired
    to: active
    trigger: The seller declares its retired type again.
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/services/persistence/participants.ts:registerParticipant'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-007
    from: active
    to: active
    trigger: The seller repeats its existing declaration.
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/services/registration/register-participant.ts'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
invariant_coverage:
  - invariant: INV-DOM-COM-ORD-003-01
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: >-
      services-commerce:modules/participants/db/participant-product-types.table.ts:participant_product_types_active_owner_uidx
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-02
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/db/participants.table.ts'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-03
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: >-
      services-commerce:modules/participants/services/registration/register-participant.ts;
      modules/participants/services/persistence/participants.ts:claimFunctionProblems
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-04
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/services/registration/register-participant.ts'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-05
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: >-
      services-commerce:modules/participants/services/client/lambda-participant-client.ts;
      modules/participants/services/client/participant-invocation.ts
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-06
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/orders/services/placement/claims-at-placement.ts'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-07
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: unknown
    source: 'services-commerce:modules/participants/aws/logic/participant-registration.lambda.ts'
    note: Broader invariant coverage remains open beyond the concrete examples.
workflow_coverage:
  - workflow: WF-COM-ORD-002
    scenarios:
      - ATS-COM-ORD-005-19
    gap: FND-COM-ORD-069
    provenance: proposed
    source:
      - 'services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js'
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#refuses a placement made
        after the T-shirt was gone with the same 409 claim_conflict, never a preparation refusal
      - 'services-commerce:modules/checkout/tests/e2e/engine-pricing.e2e.spec.js'
      - >-
        services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#is a tax_quote_refused problem
        on the preview and refuses the placement, placing nothing
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#rolled the first seat claim
        back with the transaction, and left the booth held for the buyer to retry with
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#confirms it on the sweep:
        the ledger committed, the participant’s claim committed, claim_confirmed on the order
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves the order placed and
        pending with one attempt; the buyer’s tender bills it first and proceeds
  - workflow: WF-COM-ORD-009
    scenarios:
      - ATS-COM-ORD-013-15
    gap: FND-COM-ORD-069
    provenance: proposed
    source:
      - 'services-commerce:modules/entitlements/services/register/grant-handler.ts'
      - >-
        services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#delivered the obligation to
        the register: completed, with the grant as its record
      - >-
        services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#gives two downloads and
        refuses the third 409 insufficient_entitlement
      - >-
        services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#restores use 1 (an
        intervention: the log row, the history, the audit event), replays under the same key, refuses the same
        use under another
      - 'services-commerce:modules/fulfillment/services/register/intervention-audit.ts'
      - 'services-commerce:modules/entitlements/services/register/revocation.ts'
      - 'services-commerce:modules/entitlements/services/register/entitlement-sweeper.ts'
  - workflow: WF-COM-ORD-014
    scenarios: []
    gap: FND-COM-ORD-069
    provenance: proposed
    source:
      - 'services-commerce:modules/participants/aws/logic/participant-registration.lambda.ts'
      - 'services-commerce:modules/participants/services/registration/register-participant.ts:parseManifest'
      - 'services-commerce:modules/participants/services/persistence/participants.ts'
interaction_coverage:
  - with: CAP-COM-ORD-003
    scenarios:
      - ATS-COM-ORD-012-13
  - with: CAP-COM-ORD-005
    scenarios:
      - ATS-COM-ORD-012-14
  - with: CAP-COM-ORD-013
    scenarios:
      - ATS-COM-ORD-012-15
unproved_rules: []
---

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

## Coverage

| Rule | Scenario or finding |
|---|---|
| `BR-CAP-COM-ORD-012-01` | `ATS-COM-ORD-012-01` |
| `BR-CAP-COM-ORD-012-02` | `ATS-COM-ORD-012-02` |
| `BR-CAP-COM-ORD-012-03` | `ATS-COM-ORD-012-03` |
| `BR-CAP-COM-ORD-012-04` | `ATS-COM-ORD-012-09` |
| `BR-CAP-COM-ORD-012-05` | `ATS-COM-ORD-012-04`, `ATS-COM-ORD-012-13` |
| `BR-CAP-COM-ORD-012-06` | `ATS-COM-ORD-012-05` |
| `BR-CAP-COM-ORD-012-07` | `ATS-COM-ORD-012-06` |
| `BR-CAP-COM-ORD-012-08` | `ATS-COM-ORD-012-07` |
| `BR-CAP-COM-ORD-012-09` | `ATS-COM-ORD-012-10` |
| `BR-CAP-COM-ORD-012-10` | `ATS-COM-ORD-012-11` |
| `BR-CAP-COM-ORD-012-11` | `ATS-COM-ORD-012-12` |
| `BR-CAP-COM-ORD-012-12` | `ATS-COM-ORD-012-08`, `ATS-COM-ORD-012-14` |
| `BR-CAP-COM-ORD-012-13` | `ATS-COM-ORD-012-15` |

## Interactions With Related Capabilities

Unavailable application advice leaves shopping recoverable. The owning application stops answering advice. Preview and place, restore the application and preview again.

Application claim order remains stable during placement. A cart draws resources from two applications in opposing item order. Race it against a second cart with the same resources and inspect claim calls.

Grant delivery uses the specification frozen by the selling application. A purchased line freezes a two-use download specification. Change the live product to a different allowance, then run grant delivery.

Crossing workflow examples also cover preparation, commitment and recovery at their service handoffs. Their structured bindings distinguish specified outcomes from executable evidence.
