---
id: ATS-COM-ORD-005
scope: CAP-COM-ORD-005
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-005-01
    title: Placement retry identifies the original sale
    level: api
    proves:
      - BR-CAP-COM-ORD-005-01
    preconditions: An editable cart is ready for placement.
    steps:
      - do: 'Submit without a key, submit with a key, retry it and then use a different key.'
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same order to a retry
          under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
    expected: >-
      The missing-key request fails, one sale is created, its response replays and the changed-key request is
      refused.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same order to a retry
        under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses a placement of the placed
        checkout under another key, 409 idempotency_key_mismatch
      - >-
        services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#refuses a required route without
        an Idempotency-Key, 400 idempotency_key_required, before the handler runs
      - >-
        services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#answers the stored status and
        body, marked Idempotent-Replayed, and runs the placement once: one order row
      - TST-COM-ORD-035
      - TST-COM-ORD-030
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same order to a retry
      under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
    category: invariant
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same order to a retry
      under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
  - id: ATS-COM-ORD-005-02
    title: Concurrent requests produce one sale
    level: api
    proves:
      - BR-CAP-COM-ORD-005-02
    preconditions: Two requests target the same open cart and placement key.
    steps:
      - do: Submit them concurrently and retry any in-progress result.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other
          is told the request is in progress (409) or answered the one order; exactly one order row exists
    expected: The order count remains one and successful responses identify that order.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other is
        told the request is in progress (409) or answered the one order; exactly one order row exists
      - >-
        services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#is told the request is in
        progress, 409 request_in_progress with Retry-After: 2, and places nothing
      - TST-COM-ORD-035
      - TST-COM-ORD-030
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other is
      told the request is in progress (409) or answered the one order; exactly one order row exists
    category: concurrency
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other is
      told the request is in progress (409) or answered the one order; exactly one order row exists
  - id: ATS-COM-ORD-005-03
    title: A reviewed price change requires another preview
    level: api
    proves:
      - BR-CAP-COM-ORD-005-03
    preconditions: A previewed product price is changed upward or downward.
    steps:
      - do: 'Attempt placement, request a fresh preview and place again.'
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses PRICE_CHANGED with both
          prices when the price rose since a preview of a moment ago, the checkout left open
    expected: The first attempt reports both prices and leaves the cart open; the confirmed retry uses the new price.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses PRICE_CHANGED with both
        prices when the price rose since a preview of a moment ago, the checkout left open
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses a price that fell the same
        way: the amount shown never changes silently
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#binds the new price once the
        customer previews again, with no price_tolerance adjustment
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#binds a never-previewed checkout at
        the price of the moment, even one that moved since the checkout opened
      - >-
        services-commerce:modules/orders/tests/unit/placement/price-binding.spec.js#never honours a line whose
        qualified audiences changed since the preview, at the same amount too (member pricing 05 §4)
      - TST-COM-ORD-035
      - TST-COM-ORD-139
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses PRICE_CHANGED with both
      prices when the price rose since a preview of a moment ago, the checkout left open
    category: boundary
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses PRICE_CHANGED with both
      prices when the price rose since a preview of a moment ago, the checkout left open
  - id: ATS-COM-ORD-005-04
    title: Audience lapse does not silently change the sale
    level: api
    proves:
      - BR-CAP-COM-ORD-005-04
    preconditions: A member preview has qualified pricing before the qualification lapses.
    steps:
      - do: Attempt placement and inspect the cart and earlier orders.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#refuses the
          placement 409 placement_refused with audience_lapsed and the decision’s sentence, never repricing
          silently
    expected: The request reports audience_lapsed and retains an open cart while earlier purchases remain unchanged.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#refuses the
        placement 409 placement_refused with audience_lapsed and the decision’s sentence, never repricing
        silently
      - >-
        services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#leaves the checkout
        open with the refusal on its trail, and placed no order
      - >-
        services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#14. leaves the order
        placed before the lapse as it was: no retroactive repricing
      - TST-COM-ORD-031
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#refuses the placement
      409 placement_refused with audience_lapsed and the decision’s sentence, never repricing silently
    category: edge
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#refuses the placement
      409 placement_refused with audience_lapsed and the decision’s sentence, never repricing silently
  - id: ATS-COM-ORD-005-05
    title: Failed preparation leaves no purchase record
    level: api
    proves:
      - BR-CAP-COM-ORD-005-05
    preconditions: Application fixtures refuse preparation or report unavailable items.
    steps:
      - do: Submit the carts for placement.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 409 placement_refused
          with the participant’s problem naming the item
    expected: >-
      The response identifies the rejected item, creates no order and preserves unfrozen cart items with
      refusal history.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 409 placement_refused with
        the participant’s problem naming the item
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#placed nothing: no order, the
        checkout still open with its items unfrozen, the refusal on its trail
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses an item the stub answers
        unavailable the same way (sold out)
      - TST-COM-ORD-035
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 409 placement_refused with
      the participant’s problem naming the item
    category: failure
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 409 placement_refused with
      the participant’s problem naming the item
  - id: ATS-COM-ORD-005-06
    title: Competing resource claims commit or roll back together
    level: api
    proves:
      - BR-CAP-COM-ORD-005-06
    preconditions: Two buyers compete for the final unit and another cart includes one unavailable claim.
    steps:
      - do: Place the competing carts and the multi-claim cart.
        provenance: test
        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
    expected: >-
      One final-unit purchase wins; failed placement rolls back the other claims and preserves held retry
      resources.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        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
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#placed nothing for the
        loser: the checkout open, the refusal on its trail; one claim on the resource
      - >-
        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#places the checkout: the
        hold re-affirmed and converted in TX-P, the ledger committed on the line, the claim frozen on the
        purchase
      - TST-COM-ORD-029
    provenance: test
    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
    category: concurrency
    expected_provenance: test
    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
  - id: ATS-COM-ORD-005-07
    title: Purchasing eligibility is rechecked at commitment
    level: api
    proves:
      - BR-CAP-COM-ORD-005-07
    preconditions: The product requires eligibility with ineligible and indeterminate fixture verdicts.
    steps:
      - do: Attempt placement under each verdict.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
          placement 409 product_not_eligible naming the product (id and name) and the reason
    expected: The refusal identifies the product and reason and creates no order.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
        placement 409 product_not_eligible naming the product (id and name) and the reason
      - >-
        services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
        placement 409 product_not_eligible, indeterminate, closed
      - >-
        services-commerce:modules/checkout/tests/unit/checkout/checkout-purchase-eligibility.spec.js#refuses a
        decision under review as not eligible
      - TST-COM-ORD-036
      - TST-COM-ORD-052
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
      placement 409 product_not_eligible naming the product (id and name) and the reason
    category: permission
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
      placement 409 product_not_eligible naming the product (id and name) and the reason
  - id: ATS-COM-ORD-005-08
    title: Promotion commitment rejects a changed verdict
    level: api
    proves:
      - BR-CAP-COM-ORD-005-08
    preconditions: An applied offer qualified at preview but not at placement.
    steps:
      - do: Submit placement after the eligibility change.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the placement
          409 promotion_refused, purchaser_not_eligible
    expected: The response reports promotion_refused with no order or redemption retained.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the placement
        409 promotion_refused, purchaser_not_eligible
      - >-
        services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#rolls everything back:
        no order, no use, the checkout open
      - TST-COM-ORD-037
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the placement 409
      promotion_refused, purchaser_not_eligible
    category: failure
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the placement 409
      promotion_refused, purchaser_not_eligible
  - id: ATS-COM-ORD-005-09
    title: Placement stamps the sale consistently
    level: api
    proves:
      - BR-CAP-COM-ORD-005-09
    preconditions: A simple cart is created with a configured number seed.
    steps:
      - do: 'Place it and inspect the header, lines and address snapshot.'
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
          numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
    expected: >-
      The fixture number is assigned, billing starts pending, line pricing uses the placement instant and an
      absent address stays absent.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
        numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#stamps every item line’s
        price_as_of with the order’s placed_at, one instant (COMM-M2 R2-2)
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#freezes no billing address when CRM
        holds none for the bill-to party (COMM-M2 R2-2)
      - TST-COM-ORD-035
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order: numbered
      10000, placed, pending billing, pay now with a thirty-minute tender window, created
    category: transition
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order: numbered
      10000, placed, pending billing, pay now with a thirty-minute tender window, created
  - id: ATS-COM-ORD-005-10
    title: Frozen purchases retain the bundle connection
    level: api
    proves:
      - BR-CAP-COM-ORD-005-10
    preconditions: A shirt is the parent of a bundled pin.
    steps:
      - do: Place and read the resulting order and cart.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#writes one line per item with its
          frozen purchase: the canonical payload, the stub’s attestation, the plan, no claim
    expected: >-
      Both lines retain their attested purchase details, the child points to its parent line and the placed
      cart names the order.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#writes one line per item with its
        frozen purchase: the canonical payload, the stub’s attestation, the plan, no claim
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#places the pin under the shirt with
        its parent_line_id naming the shirt’s line
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#reads the order whole: lines,
        purchases, tenders (none), invoices (none), the two pending obligations, the placed event
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#leaves the checkout placed, naming
        the order, its items frozen with what prepare attested, and its trail telling the story
      - TST-COM-ORD-035
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#writes one line per item with its
      frozen purchase: the canonical payload, the stub’s attestation, the plan, no claim
    category: invariant
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#writes one line per item with its
      frozen purchase: the canonical payload, the stub’s attestation, the plan, no claim
  - id: ATS-COM-ORD-005-11
    title: Shipping configuration gaps stop placement
    level: api
    proves:
      - BR-CAP-COM-ORD-005-11
    preconditions: Express shipping is selected under a policy without a shipping product.
    steps:
      - do: Submit the cart for placement.
        provenance: test
        source: >-
          services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#refuses the placement 409
          placement_refused with the problem shipping_product_required, naming the profile
    expected: The response contains shipping_product_required and retains an open cart.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#refuses the placement 409
        placement_refused with the problem shipping_product_required, naming the profile
      - TST-COM-ORD-163
    provenance: test
    source: >-
      services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#refuses the placement 409
      placement_refused with the problem shipping_product_required, naming the profile
    category: validation
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#refuses the placement 409
      placement_refused with the problem shipping_product_required, naming the profile
  - id: ATS-COM-ORD-005-12
    title: Cart editing authority cannot place an order
    level: api
    proves:
      - BR-CAP-COM-ORD-005-12
    preconditions: The clerk has checkout editing permission without order creation permission.
    steps:
      - do: Add an item and then attempt placement.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#a clerk without
          commerce.orders.create changes a checkout but is refused the placement
    expected: The item change succeeds and placement returns 403.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#a clerk without
        commerce.orders.create changes a checkout but is refused the placement
      - TST-COM-ORD-025
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#a clerk without
      commerce.orders.create changes a checkout but is refused the placement
    category: permission
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#a clerk without
      commerce.orders.create changes a checkout but is refused the placement
  - id: ATS-COM-ORD-005-13
    title: Deferred lease confirmation resumes on the next pass
    category: transition
    level: api
    proves:
      - BR-CAP-COM-ORD-005-13
    preconditions: A placed purchase has an unconfirmed lease.
    steps:
      - do: Run the reservation pass after the owner can confirm.
        provenance: test
        source: >-
          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
    expected: The lease and resource are committed and the sale history contains confirmation.
    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#confirms it on the sweep:
        the ledger committed, the participant’s claim committed, claim_confirmed on the order
      - TST-COM-ORD-029
    provenance: test
    source: >-
      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
    expected_provenance: test
    expected_source: >-
      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
  - id: ATS-COM-ORD-005-14
    title: Database placement uniqueness survives two waiting writers
    category: concurrency
    level: api
    proves:
      - BR-CAP-COM-ORD-005-02
      - INV-DOM-COM-ORD-002-02
    preconditions: Two database connections insert an order for the same cart.
    steps:
      - do: 'Hold the first transaction, observe the second waiting, then commit the first.'
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other
          is told the request is in progress (409) or answered the one order; exactly one order row exists
    expected: One order remains and the second insert is refused.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/integration/services/persistence/orders.integration.spec.js#lets
        the first placement succeed
      - >-
        services-commerce:modules/orders/tests/integration/services/persistence/orders.integration.spec.js#refuses
        the second 409 once the first committed, by the checkout’s uniqueness
      - >-
        services-commerce:modules/orders/tests/integration/services/persistence/orders.integration.spec.js#leaves
        exactly one order for the checkout
      - TST-COM-ORD-103
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other is
      told the request is in progress (409) or answered the one order; exactly one order row exists
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the order; the other is
      told the request is in progress (409) or answered the one order; exactly one order row exists
  - id: ATS-COM-ORD-005-15
    title: The sale preserves the policy selected during shopping
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-002-08
      - BR-CAP-COM-ORD-005-09
    preconditions: A cart uses an explicit policy with a known version.
    steps:
      - do: 'Place it, change the policy and read the order.'
        provenance: proposed
        source:
          - >-
            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)
          - >-
            services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
            numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
    expected: The sale retains the original version and selected settlement settings.
    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/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)
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
        numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-002
    related_capabilities:
      - CAP-COM-ORD-002
    expected_provenance: proposed
    expected_source:
      - >-
        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)
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
        numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
  - id: ATS-COM-ORD-005-16
    title: A changed promotion verdict rolls back purchase commitment
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-004-06
      - BR-CAP-COM-ORD-005-08
    preconditions: A reviewed code is eligible but its subject becomes ineligible before placement.
    steps:
      - do: Place the cart and inspect order and redemption records.
        provenance: proposed
        source:
          - >-
            services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#takes one use of the code and
            of the promotion
          - >-
            services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the
            placement 409 promotion_refused, purchaser_not_eligible
    expected: The request refuses the promotion and retains neither an order nor a redemption.
    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/promotions.e2e.spec.js#takes one use of the code and of
        the promotion
      - >-
        services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the placement
        409 promotion_refused, purchaser_not_eligible
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-004
    related_capabilities:
      - CAP-COM-ORD-004
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#takes one use of the code and of
        the promotion
      - >-
        services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses the placement
        409 promotion_refused, purchaser_not_eligible
  - id: ATS-COM-ORD-005-17
    title: Committed placement can wait for its invoice
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-005-09
      - BR-CAP-COM-ORD-006-01
    preconditions: The fixture Accounting port gives no answer at placement.
    steps:
      - do: 'Place the cart, inspect the sale and retry billing with the original key.'
        provenance: proposed
        source:
          - >-
            services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
            numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
            placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
            carrying its invoice line
    expected: One sale stands pending billing and the recovered invoice belongs to that sale.
    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/placement.e2e.spec.js#answers 200 with the order:
        numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-006
    related_capabilities:
      - CAP-COM-ORD-006
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with the order:
        numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
  - id: ATS-COM-ORD-005-18
    title: A declined card preserves the one created sale
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-005-01
      - BR-CAP-COM-ORD-007-05
    preconditions: A cart is ready to place and its first card is declined.
    steps:
      - do: 'Place, submit the declined card and then an approved card.'
        provenance: proposed
        source:
          - >-
            services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same order to a
            retry under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200 declined
            with the processor’s code, the order still placed with its pro forma, the attempt declined
    expected: Both attempts identify the original sale and only the approved attempt accepts it.
    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/placement.e2e.spec.js#answers the same order to a retry
        under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200 declined with
        the processor’s code, the order still placed with its pro forma, the attempt declined
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-007
    related_capabilities:
      - CAP-COM-ORD-007
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same order to a retry
        under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200 declined with
        the processor’s code, the order still placed with its pro forma, the attempt declined
  - id: ATS-COM-ORD-005-19
    title: Purchase preparation commits before billing is attempted
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-005-01
      - BR-CAP-COM-ORD-002-01
      - BR-CAP-COM-ORD-004-01
      - BR-CAP-COM-ORD-012-01
      - BR-CAP-COM-ORD-006-01
    preconditions: 'The cart has a selected policy, an eligible offer and an application-owned item.'
    steps:
      - do: 'Preview, place, inspect frozen claims and redemption, then inspect the billing request.'
        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
    expected: One sale retains the reviewed policy and application details before its keyed invoice request.
    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/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
    exercises:
      - CAP-COM-ORD-005
      - CAP-COM-ORD-002
      - CAP-COM-ORD-004
      - CAP-COM-ORD-012
      - CAP-COM-ORD-006
    workflows:
      - WF-COM-ORD-002
    expected_provenance: proposed
    expected_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
evidence:
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js#a clerk
    without commerce.orders.create changes a checkout but is refused the placement
  - >-
    Examined reference: 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
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#placed
    nothing for the loser: the checkout open, the refusal on its trail; one claim on the resource
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#places the
    checkout: the hold re-affirmed and converted in TX-P, the ledger committed on the line, the claim frozen
    on the purchase
  - >-
    Examined reference: 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
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#answers the
    stored status and body, marked Idempotent-Replayed, and runs the placement once: one order row
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#is told the
    request is in progress, 409 request_in_progress with Retry-After: 2, and places nothing
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#refuses a
    required route without an Idempotency-Key, 400 idempotency_key_required, before the handler runs
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#14.
    leaves the order placed before the lapse as it was: no retroactive repricing
  - >-
    Examined reference:
    services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#leaves the checkout open
    with the refusal on its trail, and placed no order
  - >-
    Examined reference:
    services-commerce:modules/checkout/tests/e2e/member-pricing-placement.e2e.spec.js#refuses the placement
    409 placement_refused with audience_lapsed and the decision’s sentence, never repricing silently
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 200 with
    the order: numbered 10000, placed, pending billing, pay now with a thirty-minute tender window, created
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers 409
    placement_refused with the participant’s problem naming the item
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#answers the same
    order to a retry under the same key, replayed from the idempotency ledger, writing nothing (08 row 9; D11)
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#binds a
    never-previewed checkout at the price of the moment, even one that moved since the checkout opened
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#binds the new price
    once the customer previews again, with no price_tolerance adjustment
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#freezes no billing
    address when CRM holds none for the bill-to party (COMM-M2 R2-2)
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#leaves the checkout
    placed, naming the order, its items frozen with what prepare attested, and its trail telling the story
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#one places the
    order; the other is told the request is in progress (409) or answered the one order; exactly one order row
    exists
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#placed nothing: no
    order, the checkout still open with its items unfrozen, the refusal on its trail
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#places the pin
    under the shirt with its parent_line_id naming the shirt’s line
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#reads the order
    whole: lines, purchases, tenders (none), invoices (none), the two pending obligations, the placed event
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses
    PRICE_CHANGED with both prices when the price rose since a preview of a moment ago, the checkout left open
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses a placement
    of the placed checkout under another key, 409 idempotency_key_mismatch
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses a price
    that fell the same way: the amount shown never changes silently
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#refuses an item the
    stub answers unavailable the same way (sold out)
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#stamps every item
    line’s price_as_of with the order’s placed_at, one instant (COMM-M2 R2-2)
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#writes one line per
    item with its frozen purchase: the canonical payload, the stub’s attestation, the plan, no claim
  - >-
    Examined reference:
    services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
    placement 409 product_not_eligible naming the product (id and name) and the reason
  - >-
    Examined reference:
    services-commerce:modules/checkout/tests/e2e/product-purchase-eligibility.e2e.spec.js#refuses the
    placement 409 product_not_eligible, indeterminate, closed
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses
    the placement 409 promotion_refused, purchaser_not_eligible
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#rolls
    everything back: no order, no use, the checkout open
  - >-
    Examined reference:
    services-commerce:modules/checkout/tests/unit/checkout/checkout-purchase-eligibility.spec.js#refuses a
    decision under review as not eligible
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/placement/price-binding.spec.js#never
    honours a line whose qualified audiences changed since the preview, at the same amount too (member pricing
    05 §4)
  - >-
    Examined reference: services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#refuses the
    placement 409 placement_refused with the problem shipping_product_required, naming the profile
coverage:
  rule: 'gap: FND-COM-ORD-062'
  transition: 'gap: FND-COM-ORD-062'
  validation: covered
  permission: 'gap: FND-COM-ORD-062'
  edge: covered
  failure: covered
  boundary: covered
  concurrency: covered
  invariant: 'gap: FND-COM-ORD-062'
  interaction: covered
coverage_definition: Covered means a design scenario exists; executable coverage and execution results are separate.
permission_coverage:
  - key: commerce.orders.create
    where_checked: api
    scenarios:
      - ATS-COM-ORD-005-12
    gap: FND-COM-ORD-062
    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-062
transition_coverage:
  - state_model: STATE-COM-ORD-001
    from: open
    to: preparing
    trigger: Placement begins its commit after remote assessment succeeds.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/placement/place-order.ts:placeOrder'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-001
    from: preparing
    to: placed
    trigger: The placement transaction completes its sale and dependent writes.
    scenarios:
      - ATS-COM-ORD-005-10
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#leaves the checkout placed, naming
      the order, its items frozen with what prepare attested, and its trail telling the story
    note: The cited test exercises this transition; other transitions retain separate gaps.
  - state_model: STATE-COM-ORD-001
    from: preparing
    to: open
    trigger: The declared rollback destination permits return to shopping.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/persistence/checkouts.ts:CHECKOUT_TRANSITIONS'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-001
    from: open
    to: abandoned
    trigger: A caller abandons shopping or the composer replaces the purchasing parties.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#releases every hold when the
      checkout is abandoned
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-001
    from: open
    to: abandoned
    trigger: The expiry pass discovers an overdue cart.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/checkout/checkout-sweeper.ts:sweepExpiredCheckouts'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-001
    from: open
    to: cancelled
    trigger: The map permits internal cart cancellation without a current caller.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/persistence/checkouts.ts:CHECKOUT_TRANSITIONS'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-002
    from: unvalidated
    to: advised
    trigger: The assessment obtains participant advice.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/checkout/checkout-assessment.ts'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-002
    from: unvalidated
    to: problems
    trigger: 'Assessment records seller, price or eligibility blockers.'
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/checkout/checkout-assessment.ts'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-002
    from: advised
    to: unvalidated
    trigger: Selection editing or preprocessing changes the item.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/services/checkout/checkout-workflow.ts:changeItem;
      modules/checkout/services/checkout/checkout-preprocessing.ts
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-002
    from: unvalidated
    to: prepared
    trigger: The seller answers an early reservation request.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#acquires the hold: 200 with
      the reservation held, the item prepared with it, the participant’s row held, hold_acquired on the trail
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-002
    from: prepared
    to: stale
    trigger: Reservation expiry discovers the item's elapsed hold.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#expires the ledger’s row,
      marks the item stale with hold_expired on the trail, and counts it
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-002
    from: advised
    to: frozen
    trigger: Placement captures newly prepared purchase details.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/placement/place-order.ts:placeOrder'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-003
    from: held
    to: committed
    trigger: Placement converts a hold or a later pass confirms a placed lease.
    scenarios:
      - ATS-COM-ORD-005-06
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#places the checkout: the hold
      re-affirmed and converted in TX-P, the ledger committed on the line, the claim frozen on the purchase
    note: The cited test exercises this transition; other transitions retain separate gaps.
  - state_model: STATE-COM-ORD-003
    from: held
    to: expired
    trigger: The reservation pass discovers a lapsed unplaced hold.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/reservations/reservation-sweeper.ts:sweepReservations'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-003
    from: held
    to: released
    trigger: Item removal or cart abandonment returns held resources.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/checkout/hold-release.ts:releaseHeldReservations'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-003
    from: committed
    to: released
    trigger: Void or after-sale execution returns committed resources.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#releases a placed order’s
      committed claims on void, cancels its pending obligations and leaves claims_released on its history
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-003
    from: committed
    to: consumed
    trigger: Delivery completes using the committed claim.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/persistence/reservations.ts:RESERVATION_TRANSITIONS'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-003
    from: held
    to: mismatch
    trigger: Lease confirmation reports expired capacity or conflict.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/placement/lease-confirmation.ts:confirmLease'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: placed
    to: accepted
    trigger: 'Billing permits terms or no-payment acceptance, or successful payment covers the required amount.'
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers 200: the attempt
      succeeded with Accounting’s payment, the order accepted, the pro forma converted by that first money
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: placed
    to: tender_uncertain
    trigger: Accounting cannot give a final payment result.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers uncertain, the order
      tender_uncertain, the attempt uncertain naming Accounting’s intent
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: tender_uncertain
    to: accepted
    trigger: Recovery confirms enough captured payment to accept.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#accepts the order once
      Accounting holds the payment, with one charge and the payment on the attempt
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: tender_uncertain
    to: placed
    trigger: Recovery ends without enough payment or finds no remaining open attempt.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/tender/tender-order.ts'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: placed
    to: voided
    trigger: A staff void or elapsed-deadline pass ends the sale.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#answers 200 with the order voided,
      carrying the reason, its lines and the history
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: accepted
    to: cancelled
    trigger: Completed cancellation leaves no item quantity standing.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#lists the order’s cancellations and
      reads one; cancelling the mug too closes the order cancelled (B5)
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-004
    from: accepted
    to: closed
    trigger: The lifecycle offers closure without a current producer.
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/persistence/orders.ts:ORDER_TRANSITIONS'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
invariant_coverage:
  - invariant: INV-DOM-COM-ORD-001-01
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/db/checkouts.table.ts:checkouts_placed_order_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-02
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/db/checkouts.table.ts:checkouts_placed_order_uq'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-03
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/db/checkouts.table.ts:checkouts_currency_check,
      checkouts_ordering_profile_source_check
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-04
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/services/persistence/checkouts.ts:CHECKOUT_TRANSITIONS'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-05
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js#leaves the checkout placed, naming
      the order, its items frozen with what prepare attested, and its trail telling the story;
      services-commerce:modules/checkout/services/persistence/checkouts.ts:updateCheckout, appendCheckoutEvent
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-06
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/db/checkouts.table.ts:checkouts_ship_to_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-07
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/checkout/tests/e2e/checkout-security.e2e.spec.js'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-001-08
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/db/checkout-items.table.ts:checkout_items_quantity_check;
      modules/checkout/services/checkout/checkout-part-checks.ts
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-01
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/orders.table.ts:orders_total_check, orders_amounts_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-02
    scenarios:
      - ATS-COM-ORD-005-14
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#answers the stored status and body,
      marked Idempotent-Replayed, and runs the placement once: one order row;
      services-commerce:modules/orders/db/orders.table.ts:orders_checkout_uq
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-03
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/orders.table.ts:orders_number_uq, orders_number_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-04
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/services/persistence/orders.ts:ORDER_TRANSITIONS'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-05
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-lines.table.ts:order_lines_quantity_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-06
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/db/order-line-purchases.table.ts:order_line_purchases_write_once_trigger
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-07
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#resumes the same attempt on a
      retry, whatever card the retry names, and moves nothing while the intent is processing
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-08
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-invoices.table.ts:order_invoices_idempotency_key_uq'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-09
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-events.table.ts'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-10
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-lines.table.ts:order_lines_order_fk'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-11
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: 'services-commerce:modules/orders/db/orders.table.ts:orders_installment_schedule_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-12
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#never stores the card: the
      attempt keeps a reference of the merchant account and the token’s last four only
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-13
    scenarios: []
    gap: FND-COM-ORD-062
    provenance: unknown
    source: >-
      services-commerce:modules/orders/db/reservations.table.ts:reservations_subject_check;
      modules/orders/services/persistence/reservations.ts:RESERVATION_TRANSITIONS
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-003-01
    scenarios: []
    gap: FND-COM-ORD-062
    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-062
    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-062
    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-062
    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-062
    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-062
    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-062
    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-062
    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-003
    scenarios:
      - ATS-COM-ORD-006-16
    gap: FND-COM-ORD-062
    provenance: proposed
    source:
      - 'services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js'
      - 'services-commerce:modules/orders/services/billing/bill-order.ts:billOrder'
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real invoice at
        placement and accepts the order on terms, the obligation waiting on the invoice
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
  - workflow: WF-COM-ORD-006
    scenarios:
      - ATS-COM-ORD-001-20
    gap: FND-COM-ORD-062
    provenance: proposed
    source:
      - 'services-commerce:modules/checkout/aws/lambda/SWEEPER.ts:handler'
      - 'services-commerce:modules/orders/services/reservations/reservation-sweeper.ts:sweepReservations'
      - 'services-commerce:modules/orders/services/orders/tender-window-sweeper.ts:sweepTenderWindows'
      - 'services-commerce:modules/checkout/aws/lambda/SWEEPER.ts:handler'
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepFinancials'
      - 'services-commerce:modules/entitlements/services/register/entitlement-sweeper.ts:sweepEntitlements'
      - 'services-commerce:modules/checkout/aws/lambda/SWEEPER.ts:handler'
  - workflow: WF-COM-ORD-011
    scenarios:
      - ATS-COM-ORD-015-15
    gap: FND-COM-ORD-062
    provenance: proposed
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409
        order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another
        tenant
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended
        with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation
        superseding the delivered fulfilment
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credited the unused value from the
        original payment and applied it to the change invoice; the document awaits the buyer’s tender
      - 'services-commerce:modules/orders/services/amendments/amendment-settlement.ts:onChangeOrderVoided'
      - 'services-commerce:modules/orders/services/orders/accept-order.ts:acceptOrder'
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#completes once the buyer’s card
        accepts the change order and the worker delivers the modify: the original fulfilment superseded
interaction_coverage:
  - with: CAP-COM-ORD-002
    scenarios:
      - ATS-COM-ORD-005-15
  - with: CAP-COM-ORD-004
    scenarios:
      - ATS-COM-ORD-005-16
  - with: CAP-COM-ORD-006
    scenarios:
      - ATS-COM-ORD-005-17
  - with: CAP-COM-ORD-007
    scenarios:
      - ATS-COM-ORD-005-18
unproved_rules: []
---

# Create one order at the reviewed price: Capability Test Specification

## Coverage

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

## Interactions With Related Capabilities

The sale preserves the policy selected during shopping. A cart uses an explicit policy with a known version. Place it, change the policy and read the order.

A changed promotion verdict rolls back purchase commitment. A reviewed code is eligible but its subject becomes ineligible before placement. Place the cart and inspect order and redemption records.

Committed placement can wait for its invoice. The fixture Accounting port gives no answer at placement. Place the cart, inspect the sale and retry billing with the original key.

A declined card preserves the one created sale. A cart is ready to place and its first card is declined. Place, submit the declined card and then an approved card.

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