---
id: TST-COM-ORD-084
title: Returns
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/returns.e2e.spec.js
implements:
  - ATS-COM-ORD-016-01
  - ATS-COM-ORD-016-03
  - ATS-COM-ORD-016-04
  - ATS-COM-ORD-016-05
  - ATS-COM-ORD-016-06
  - ATS-COM-ORD-016-07
  - ATS-COM-ORD-016-08
  - ATS-COM-ORD-016-09
  - ATS-COM-ORD-016-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/orders/tests/e2e/returns.e2e.spec.js'
    test_cases:
      - >-
        authorizes at once under the built-in policy: the RMA numbered with its deadline, the lines
        authorized, the customer told to send it back
      - >-
        takes the warehouse’s receipt: the goods back on the line, the memo and the refund run, the document
        completed and the RMA closed
      - lists the order’s returns and reads one
      - holds the member’s request for approval; the approver authorizes it and the RMA is issued
      - lets the approver reject one with a reason; a member on the console route and a clerk are refused
      - rejects the member with final_sale; the administrator’s override authorizes it
      - >-
        lists, reads and deletes the policy; refuses a member the policies, a second policy at the scope 400,
        a tenant default with a scope id 400
      - 'charges the policy’s 10% restocking fee as an invoice paid from the freed money, and refunds the rest'
      - 'lets staff ask for a credit, and refuses a member the money action'
      - expects the deduction on the RMA and tells the customer the refund is less the return label (USD 8.40)
      - 'invoices the label on the return label fee product, pays it from the freed money and refunds the rest'
      - 'deducts nothing when the tenant pays the label, though the carrier sold one'
      - deducts nothing from a customer-paid return when no label was bought
      - >-
        leaves the document partially received with the RMA open after one of two units, and completes it
        after the second
      - >-
        lets the member withdraw an authorized return: the RMA closed and the streams told; a line already
        under a return refused meanwhile
      - >-
        refuses a placed order 409 order_not_returnable, more units than the line has (rejected), another
        member 403, a reader 403, another tenant 404
scenario_coverage:
  - scenario: ATS-COM-ORD-016-01
    test_cases:
      - >-
        refuses a placed order 409 order_not_returnable, more units than the line has (rejected), another
        member 403, a reader 403, another tenant 404
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-03
    test_cases:
      - >-
        authorizes at once under the built-in policy: the RMA numbered with its deadline, the lines
        authorized, the customer told to send it back
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-04
    test_cases:
      - holds the member’s request for approval; the approver authorizes it and the RMA is issued
      - lets the approver reject one with a reason; a member on the console route and a clerk are refused
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-05
    test_cases:
      - rejects the member with final_sale; the administrator’s override authorizes it
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-06
    test_cases:
      - >-
        takes the warehouse’s receipt: the goods back on the line, the memo and the refund run, the document
        completed and the RMA closed
      - >-
        leaves the document partially received with the RMA open after one of two units, and completes it
        after the second
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-07
    test_cases:
      - 'charges the policy’s 10% restocking fee as an invoice paid from the freed money, and refunds the rest'
      - 'lets staff ask for a credit, and refuses a member the money action'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-08
    test_cases:
      - expects the deduction on the RMA and tells the customer the refund is less the return label (USD 8.40)
      - 'invoices the label on the return label fee product, pays it from the freed money and refunds the rest'
      - 'deducts nothing when the tenant pays the label, though the carrier sold one'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-09
    test_cases:
      - >-
        lists, reads and deletes the policy; refuses a member the policies, a second policy at the scope 400,
        a tenant default with a scope id 400
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
  - scenario: ATS-COM-ORD-016-10
    test_cases:
      - >-
        lets the member withdraw an authorized return: the RMA closed and the streams told; a line already
        under a return refused meanwhile
    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/returns.e2e.spec.js'
  declared_by_test: >-
    the composed handler, the routes, the return workflow, the policy, the adjustment worker, the persistence
    services and PostgreSQL. Doubled: the signing key pair, the other services' tables (local stand-ins),
    Accounting (the fixture transport and the fixture adjustment commands), the facts port, the returns
    handling port (the fixture the running macroservice carries until the shipping and inventory streams
    land).
---

# Returns

## Verification Boundary

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

## What This Suite Proves

The registered cases check returns 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.
