---
id: TST-COM-ORD-080
title: Tax and refunds per line after an order-level discount
kind: api-lifecycle
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
repository: services-commerce
files:
  - modules/orders/tests/e2e/order-discount-tax.e2e.spec.js
implements:
  - ATS-COM-ORD-006-06
  - ATS-COM-ORD-014-11
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/orders/tests/e2e/order-discount-tax.e2e.spec.js'
    test_cases:
      - 'shares the $30.00 over the lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71'
      - 'taxes each placed line on its own net at 8 %: $6.63, $3.31 and $1.66'
      - 'makes the order’s tax the lines’ sum, $11.60, and its total $145.00 + $11.60 = $156.60'
      - 'credits the cancelled $50.00 Book its net $41.43 and its tax $3.31: $44.74'
      - >-
        estimates the refund as the credit with its tax, $44.74, the tax having been paid on the order’s tax
        line (COMM-M1 R7-1)
      - >-
        credits the Book’s net on its invoice line and its tax on the tax line, then refunds the whole $44.74
        (COMM-M1 R7-1)
scenario_coverage:
  - scenario: ATS-COM-ORD-006-06
    test_cases:
      - 'shares the $30.00 over the lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71'
      - 'taxes each placed line on its own net at 8 %: $6.63, $3.31 and $1.66'
      - 'credits the cancelled $50.00 Book its net $41.43 and its tax $3.31: $44.74'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-014-11
    test_cases:
      - >-
        credits the Book’s net on its invoice line and its tax on the tax line, then refunds the whole $44.74
        (COMM-M1 R7-1)
    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/orders/tests/e2e/order-discount-tax.e2e.spec.js'
  declared_by_test: >-
    the composed handler, the routes, the workflows, the pricing engine, the promotions library and
    persistence, the zone tax table, the cancellation workflow, PostgreSQL. Doubled: the signing key pair, the
    other services' tables and Accounting (local stand-ins).
---

# Tax and refunds per line after an order-level discount

## Verification Boundary

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

## What This Suite Proves

The registered cases check tax and refunds per line after an order-level discount 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.
