---
id: TST-COM-ORD-020
title: Automatic promotions on 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/automatic-promotions.e2e.spec.js
implements:
  - ATS-COM-ORD-004-10
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/automatic-promotions.e2e.spec.js'
    test_cases:
      - 'previews the automatic promotion on the line with no code: $25.00 less $2.50 is $22.50'
      - 'places the order at $22.50 and redeems the promotion once, with no code'
      - gives a cart it does not qualify for nothing and consumes no use
      - 'applies them by priority: Mug five (5 %) on $12.00, then Mug ten (10 %) on the $11.40 left'
      - redeems each of them once
      - 'keeps the automatic promotion when VIP5 would leave more to pay: $22.50, VIP5 explained'
      - 'consumes no use of VIP5, only the automatic promotion’s'
      - 'lets VIP20 replace the automatic promotion when it leaves less to pay: $20.00'
      - redeems VIP20 and not the automatic promotion it replaced
      - 'gives the first buyer the 10 %: $100.00 less $10.00'
      - 'gives the second buyer nothing once the one use is taken, and does not refuse the order'
      - 'counts one use, not two'
      - applies to no cart
      - applies to no cart and is not redeemed
scenario_coverage:
  - scenario: ATS-COM-ORD-004-10
    test_cases:
      - 'keeps the automatic promotion when VIP5 would leave more to pay: $22.50, VIP5 explained'
      - 'lets VIP20 replace the automatic promotion when it leaves less to pay: $20.00'
      - redeems VIP20 and not the automatic promotion it replaced
    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/automatic-promotions.e2e.spec.js'
  declared_by_test: >-
    the composed handler, the routes, the workflows, the pricing engine, the promotions library and
    persistence, PostgreSQL. Doubled: the signing key pair and the other services' tables (local stand-ins).
---

# Automatic promotions on a checkout

## Verification Boundary

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

## What This Suite Proves

The registered cases check automatic promotions on 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.
