---
id: TST-COM-ORD-003
title: 'Commerce-contracts errors: refusal codes'
kind: unit
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
repository: macroservice-libraries
files:
  - packages/commerce-contracts/src/errors.spec.ts
implements: []
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: 'The suite owns its in-memory inputs, scripted responses and rendered component state.'
evidence:
  - provenance: test
    source: 'macroservice-libraries:packages/commerce-contracts/src/errors.spec.ts'
    test_cases:
      - defines the twenty-one codes of the contract
      - 'answers the ordering-profile refusals as 409, 409 and 400 (contracts 0.3.0, 22 §3, §5, §7)'
      - names every code in snake_case with a one-line meaning
      - maps each code to a status
      - builds the error class of the prefix with the code in the message
      - knows its own codes
      - defines the seven standard codes
      - says who raises each and whether a retry may succeed
      - accepts a participant's own snake_case code on the wire and refuses a spaced one
scenario_coverage: []
dependency_evidence:
  provenance: test
  source: 'macroservice-libraries:packages/commerce-contracts/src/errors.spec.ts'
  declared_by_test: 'the constants and `refusalError`. Doubled: nothing.'
---

# Commerce-contracts errors: refusal codes

## Verification Boundary

The unit suite checks the named contract or helper with controlled inputs.

## What This Suite Proves

The registered cases check commerce-contracts errors: refusal codes 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

Inputs and external responses are controlled in process; this suite establishes no deployed service behavior.

## Must Not Be Doubled

The named contract validation or component behavior under assertion must use its actual implementation.
