---
id: TST-COM-ORD-033
title: The ordering profile of a checkout
kind: api-lifecycle
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
repository: services-commerce
files:
  - modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js
implements:
  - ATS-COM-ORD-002-01
  - ATS-COM-ORD-002-02
  - ATS-COM-ORD-002-03
  - ATS-COM-ORD-002-04
  - ATS-COM-ORD-002-05
  - ATS-COM-ORD-002-06
  - ATS-COM-ORD-002-08
  - ATS-COM-ORD-002-09
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 2
isolation: The suite creates its own test workspace records and removes them using the fixture cleanup.
evidence:
  - provenance: test
    source: 'services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js'
    test_cases:
      - explicit
      - 'carries the store’s profile with source store, in the profile’s currency, no decision on the trail'
      - >-
        carries the profile named on the create with source explicit, and refuses a currency that is not the
        profile’s, 400 currency_mismatch
      - >-
        has no profile and no currency when nothing names one and there is no item, and refuses a currency
        named on its own
      - >-
        takes the first main item’s selling context with source selling_context, the context recorded on the
        checkout and the item
      - 'takes the application default of a context that names no profile, source application_default'
      - >-
        takes the tenant default when the item’s application has no default, source tenant_default: an item
        without a context resolves by its participant
      - 'ignores a bundled item (one with a parent) when deciding, and decides at a later add'
      - >-
        refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming
        both, nothing added
      - 'refuses the conflict at the open too, writing no checkout'
      - >-
        takes an item of another context under an EXPLICIT profile: staff chose, the items’ own contexts are
        not held against it
      - 'lets staff switch it explicitly, the currency following, audited; never a portal member'
      - 'refuses a switch to a profile the tenant does not have, and to an inactive one, 400'
      - 'refuses a switch while an item’s context locks its profile, 409'
      - >-
        refuses placing without a profile, 409 placement_refused with ordering_profile_required, the refusal
        on the trail; then places once staff name one
      - >-
        refuses an empty checkout with no profile for the profile first, ordering_profile_required, and for
        its items once it has one (COM-ACC-0032)
      - >-
        refuses an empty checkout with no store empty_checkout when the workspace has a default checkout
        policy (COMM-M2 R2-5)
      - >-
        says checkout policy and workspace, never ordering profile or tenant, when nothing resolves one
        (COMM-M2 R2-5)
      - >-
        places a checkout under its profile and freezes the snapshot: the id, the version, the source, the
        context, the rules, the kind
      - >-
        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)
      - >-
        classifies an order whose main lines two applications sold as mixed, and filters the orders list by
        kind and by profile
scenario_coverage:
  - scenario: ATS-COM-ORD-002-01
    test_cases:
      - 'carries the store’s profile with source store, in the profile’s currency, no decision on the trail'
      - >-
        takes the first main item’s selling context with source selling_context, the context recorded on the
        checkout and the item
      - 'takes the application default of a context that names no profile, source application_default'
      - >-
        takes the tenant default when the item’s application has no default, source tenant_default: an item
        without a context resolves by its participant
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-02
    test_cases:
      - >-
        refuses a later main item whose context resolves another profile, 409 ordering_profile_conflict naming
        both, nothing added
      - 'refuses the conflict at the open too, writing no checkout'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-03
    test_cases:
      - 'lets staff switch it explicitly, the currency following, audited; never a portal member'
      - 'refuses a switch to a profile the tenant does not have, and to an inactive one, 400'
      - 'refuses a switch while an item’s context locks its profile, 409'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-04
    test_cases:
      - >-
        carries the profile named on the create with source explicit, and refuses a currency that is not the
        profile’s, 400 currency_mismatch
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-05
    test_cases:
      - >-
        refuses placing without a profile, 409 placement_refused with ordering_profile_required, the refusal
        on the trail; then places once staff name one
      - >-
        refuses an empty checkout with no store empty_checkout when the workspace has a default checkout
        policy (COMM-M2 R2-5)
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-06
    test_cases:
      - >-
        places a checkout under its profile and freezes the snapshot: the id, the version, the source, the
        context, the rules, the kind
      - >-
        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)
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-08
    test_cases:
      - 'ignores a bundled item (one with a parent) when deciding, and decides at a later add'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-002-09
    test_cases:
      - >-
        takes an item of another context under an EXPLICIT profile: staff chose, the items’ own contexts are
        not held against it
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
dependency_evidence:
  provenance: test
  source: 'services-commerce:modules/checkout/tests/e2e/ordering-profile-resolution.e2e.spec.js'
  declared_by_test: >-
    the composed handler, the routes, the workflows, the persistence services and PostgreSQL. Doubled: the
    signing key pair and the other services' tables (local stand-ins).
---

# The ordering profile of a checkout

## Verification Boundary

The suite drives the composed local API dispatcher and its registered routes.

## What This Suite Proves

The registered cases check the ordering profile of a checkout with their fixture records and assertions. Scenario bindings name only the examples those cases exercise.

## What It Does Not Prove

A registered file supplies no run result or verified conformance by itself. Local fixtures do not establish deployed cross-service behavior or complete browser journeys.

## Real Dependencies and Test Doubles

PostgreSQL and the exercised Commerce persistence or workflow code are real. Remote service records, clocks and transports follow the suite’s fixtures.

## Must Not Be Doubled

The database constraints, role restrictions, locks and transactions exercised by this suite must use PostgreSQL.
