---
id: TST-ACC-TRX-115
title: Reversal refund status suite
kind: integration
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - >-
    modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js
implements:
  - ATS-ACC-TRX-014-06
implements_parts:
  - scenario: ATS-ACC-TRX-014-06
    assertion: it books the credit memo at once although the refund is not paid
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js#it
      books the credit memo at once although the refund is not paid
  - scenario: ATS-ACC-TRX-014-06
    assertion: it turns succeeded and completed when the signed event settles the refund
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js#it
      turns succeeded and completed when the signed event settles the refund
  - scenario: ATS-ACC-TRX-014-06
    assertion: it turns failed and completed_with_exception with the processor’s code
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js#it
      turns failed and completed_with_exception with the processor’s code
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: >-
  Suite-marked records in the prepared local test database; fixture teardown
  removes owned records.
provenance: test
source: >-
  services-accounting:modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js
    assertion_titles:
      - >-
        a reversal’s refund_status while the processor holds the refund
        (integration)
      - settled by the processor’s event
      - >-
        answers refund_status processing with the refund id and the reversal
        pending
      - books the credit memo at once although the refund is not paid
      - answers the same on a read
      - turns succeeded and completed when the signed event settles the refund
      - failed at the processor
      - turns failed and completed_with_exception with the processor’s code
      - kept as credit
      - answers a null refund_status and refund_id
    imports:
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { applyIntegrationEvents } =
        require('../../../../services/integrations/integration-events');
      - >-
        const { receivePayment } =
        require('../../../../services/payments/payment-receive');
      - >-
        const { usePaymentProcessorForTests } =
        require('../../../../services/payments/ports/payment-processor');
      - >-
        const { getReversal, reverseBilling } =
        require('../../../../services/reversals/reversal-commands');
      - '} = require(''../../payments-fixtures'');'
      - "\t\tworld.require();"
      - "\t\t\tconst { reversal, refund } = pending.require();"
      - "\t\t\tconst { reversal, credit_memo: memo } = pending.require();"
      - "\t\t\tconst { reversal } = pending.require();"
      - "\t\t\tconst { reversal, refund } = pending.require();"
      - "\t\t\tconst { outcome, outcomes } = pending.require();"
      - "\t\t\tconst { reversal } = credited.require();"
    test_double_declarations: []
---

# Reversal refund status suite

## Verification Boundary

The suite exercises transaction commands and database protections in the local prepared test environment. Registration records the existing executable file; it does not report a run or establish product approval.

## What This Suite Proves

Its cited assertions contribute evidence for refund outcome determines reversal completion. The structured assertion bindings identify which parts of combined scenarios it executes.

## What It Does Not Prove

Local commands and route invocations do not establish deployed routing, live processor guarantees or the complete staff browser experience. An unbound feature chain remains proposed, and this registration carries no execution result.

## Real Dependencies and Test Doubles

The suite uses the imported commands, route handlers or persistence code against the local test database. Fixture helpers supply accounting context; any stepped clock, dummy processor or substituted external client is retained in the evidence declarations.

## Must Not Be Doubled

The command or persistence behavior under assertion and its relevant database protections must remain real. Substituting the final financial result removes evidence of transactional effects.
