Skip to content

ATS-COM-ORD-002Select and preserve the sale’s checkout policy: Capability Test Specification

Markdown

ATS-COM-ORD-002

Select and preserve the sale’s checkout policy: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-ORD-002

Design

Executed by
TST-COM-ORD-033, TST-COM-ORD-138

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision2

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

Coverage

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

Test Scenarios

12 scenarios proving CAP-COM-ORD-002; 9 bound to an existing test.

01 Policy precedence retains the selected sourceruleapitest
Proves
BR-CAP-COM-ORD-002-01
Preconditions
Store, application and workspace defaults coexist with explicit and contextual choices.
Steps
[ { "do": "Create carts through the resolution cases present in the bindings.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the store’s profile with source store, in the profile’s currency, no decision on the trail" } ]
Expected
The returned policy and recorded origin match each exercised precedence case.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the store’s profile with source store, in the profile’s currency, no decision on the trail
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes the first main item’s selling context with source selling_context, the context recorded on the checkout and the item
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes the application default of a context that names no profile, source application_default
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes the tenant default when the item’s application has no default, source tenant_default: an item without a context resolves by its participant
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the store’s profile with source store, in the profile’s currency, no decision on the trail
02 Conflicting contexts do not create mixed-policy cartsvalidationapinegativetest
Proves
BR-CAP-COM-ORD-002-02
Preconditions
Main items resolve two different checkout policies.
Steps
[ { "do": "Create a combined cart and attempt to add the second item to an existing one.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming both, nothing added" } ]
Expected
Both paths return ordering_profile_conflict without retaining the conflicting write.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming both, nothing added
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses the conflict at the open too, writing no checkout
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming both, nothing added
03 Policy switching distinguishes staff and portal callerspermissionapitest
Proves
BR-CAP-COM-ORD-002-04
Preconditions
The fixtures include an active alternative, an inactive policy and a locked item context.
Steps
[ { "do": "Switch as staff and portal callers and exercise inactive and locked choices.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#lets staff switch it explicitly, the currency following, audited; never a portal member" } ]
Expected
Authorized switching updates currency and history; invalid or locked cases return 400 or 409 and portal access is refused.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#lets staff switch it explicitly, the currency following, audited; never a portal member
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a switch to a profile the tenant does not have, and to an inactive one, 400
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a switch while an item’s context locks its profile, 409
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#lets staff switch it explicitly, the currency following, audited; never a portal member
04 Explicit policy currency must agreevalidationapinegativetest
Proves
BR-CAP-COM-ORD-002-06
Preconditions
The explicitly selected policy uses EUR.
Steps
[ { "do": "Request that policy alongside USD during creation.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the profile named on the create with source explicit, and refuses a currency that is not the profile’s, 400 currency_mismatch" } ]
Expected
Creation returns currency_mismatch.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the profile named on the create with source explicit, and refuses a currency that is not the profile’s, 400 currency_mismatch
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#carries the profile named on the create with source explicit, and refuses a currency that is not the profile’s, 400 currency_mismatch
05 Placement waits for a resolvable policyvalidationapinegativetest
Proves
BR-CAP-COM-ORD-002-07
Preconditions
A cart has no resolvable default; another cart is empty with a default available.
Steps
[ { "do": "Attempt placement, explicitly choose a policy and retry the populated cart.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses placing without a profile, 409 placement_refused with ordering_profile_required, the refusal on the trail; then places once staff name one" } ]
Expected
The missing-policy attempt blocks, the populated retry places and the empty cart reports empty_checkout.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses placing without a profile, 409 placement_refused with ordering_profile_required, the refusal on the trail; then places once staff name one
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses an empty checkout with no store empty_checkout when the workspace has a default checkout policy (COMM-M2 R2-5)
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses placing without a profile, 409 placement_refused with ordering_profile_required, the refusal on the trail; then places once staff name one
06 Policy edits leave the earlier sale snapshot intactinvariantapitest
Proves
BR-CAP-COM-ORD-002-08
Preconditions
An order is placed using the current policy settings.
Steps
[ { "do": "Change the policy’s payment settings and read the earlier order.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#places a checkout under its profile and freezes the snapshot: the id, the version, the source, the context, the rules, the kind" } ]
Expected
The policy version advances while the order still holds its original version and methods.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#places a checkout under its profile and freezes the snapshot: the id, the version, the source, the context, the rules, the kind
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)
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#places a checkout under its profile and freezes the snapshot: the id, the version, the source, the context, the rules, the kind
07 Order kinds derive from contributing applicationsruleunittest
Proves
BR-CAP-COM-ORD-002-09
Preconditions
Input lines belong to one application, multiple applications or no item application.
Steps
[ { "do": "Run classification for each input collection.", "provenance": "test", "source": "services-commerce:modules/orders/tests/unit/placement/classify-order.spec.js#classifies an order whose item lines one application sold as that kind" } ]
Expected
The result is the single kind, mixed or general for the respective case.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/unit/placement/classify-order.spec.js#classifies an order whose item lines one application sold as that kind
services-commerce:modules/orders/tests/unit/placement/classify-order.spec.js#classifies an order whose item lines two applications sold as mixed, the kinds in line order
services-commerce:modules/orders/tests/unit/placement/classify-order.spec.js#classifies an order with no item line of an application as general: a fee-only order, or lines naming no participant
Source
services-commerce:modules/orders/tests/unit/placement/classify-order.spec.js#classifies an order whose item lines one application sold as that kind
08 A bundled item leaves policy selection to a later main itemedgeapitest
Proves
BR-CAP-COM-ORD-002-03
Preconditions
The first selection is a bundle child and policy is not yet resolved.
Steps
[ { "do": "Add a main item with a selling context.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#ignores a bundled item (one with a parent) when deciding, and decides at a later add" } ]
Expected
The later main item determines the selected policy.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#ignores a bundled item (one with a parent) when deciding, and decides at a later add
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#ignores a bundled item (one with a parent) when deciding, and decides at a later add
09 An explicit staff policy permits a different selling contextruleapitest
Proves
BR-CAP-COM-ORD-002-05
Preconditions
Staff select an active policy explicitly.
Steps
[ { "do": "Add an item whose context names another policy.", "provenance": "test", "source": "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes an item of another context under an EXPLICIT profile: staff chose, the items’ own contexts are not held against it" } ]
Expected
The item is accepted under the explicitly selected policy.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes an item of another context under an EXPLICIT profile: staff chose, the items’ own contexts are not held against it
Source
services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#takes an item of another context under an EXPLICIT profile: staff chose, the items’ own contexts are not held against it
10 A conflicting item leaves the selected cart policy intactinteractionapinegativeproposed
Proves
BR-CAP-COM-ORD-001-02 BR-CAP-COM-ORD-002-02
Preconditions
A cart already resolves one policy.
Steps
[ { "do": "Add a main item that resolves a different policy, then read the cart.", "provenance": "proposed", "source": [ "services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a quantity past the product’s purchase limit: quantity_out_of_limits", "services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming both, nothing added" ] } ]
Expected
The addition is refused and the original items and policy remain.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a quantity past the product’s purchase limit: quantity_out_of_limits,services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js#refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming both, nothing added
11 The sale preserves the policy selected during shoppinginteractionapiproposed
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.
Data
Use an isolated workspace with the records and responses named in the preconditions.
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
12 Payment follows the purchased policy after settings changeinteractionapiproposed
Proves
BR-CAP-COM-ORD-002-08 BR-CAP-COM-ORD-007-03
Preconditions
A card-enabled policy is frozen on a placed sale.
Steps
[ { "do": "Disable the card choice in the live policy and tender the earlier sale.", "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/orders/tests/e2e/billing-and-tender.e2e.spec.js#refuses an offline tender by a member, 403 tender_kind_staff_only, and a kind the profile does not allow, 409, read from the ORDER’s snapshot: the order placed before the change still allows it (22 §9)" ] } ]
Expected
The earlier sale still uses its frozen choice.
Data
Use an isolated workspace with the records and responses named in the preconditions.
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/orders/tests/e2e/billing-and-tender.e2e.spec.js#refuses an offline tender by a member, 403 tender_kind_staff_only, and a kind the profile does not allow, 409, read from the ORDER’s snapshot: the order placed before the change still allows it (22 §9)

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.