---
id: TST-ACC-TRX-123
title: Settlement linkage 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/settlements/settlement-linkage.integration.spec.js
implements: []
implements_parts: []
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/settlements/settlement-linkage.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/settlements/settlement-linkage.integration.spec.js
    assertion_titles:
      - what a settlement leaves to be traced and read (integration)
      - the payment a settlement recorded
      - answers its settlement in the settlement’s own answer
      - answers its settlement in the get
      - answers its settlement in the list
      - answers a null settlement for a payment no settlement recorded
      - a card settlement
      - names its settlement on the payment and on the intent it made
      - a settlement whose card was declined
      - 'names the failed intent, and the intent names the settlement'
      - the credit application of a settlement
      - 'names its credit by number, not only by id'
      - >-
        answers the line’s total and its balance before and after: 6000 total,
        4000 owed before the credit, 2500 after
    imports:
      - 'const { sql } = require(''drizzle-orm'');'
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { createCredit } =
        require('../../../../services/credits/credit-commands');
      - >-
        const { getCreditApplication } =
        require('../../../../services/credits/credit-reads');
      - >-
        const { getPayment, getPaymentIntent, listPaymentPage } =
        require('../../../../services/payments/payment-reads');
      - >-
        const { findSettlementOfKey, settle } =
        require('../../../../services/settlements/settlement-commands');
      - '} = require(''../../payments-fixtures'');'
      - "\t\tconst { invoice } = world.require();"
      - "\t\tconst { invoice } = world.require();"
      - "\t\tbyCheck.require();"
      - "\t\tconst { invoice } = world.require();"
      - "\t\t\tconst outcome = byCheck.require();"
      - "\t\t\tconst outcome = byCheck.require();"
      - "\t\t\tconst outcome = byCheck.require();"
      - "\t\t\tconst { receivePayment } = require('../../../../services/payments/payment-receive');"
      - "\t\t\tconst { checkPaymentRequest } = require('../../payments-fixtures');"
      - "\t\t\tconst outcome = byCard.require();"
      - "\t\t\tconst { refusal, row } = declined.require();"
      - "\t\t\tconst { credit, outcome } = byCredit.require();"
      - "\t\t\tconst { outcome } = byCredit.require();"
    test_double_declarations: []
---

# Settlement linkage 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

The executable assertions exercise this module, but no capability or feature scenario binding is established for this file. Its individual assertion titles remain in the evidence register for subsequent mapping.

## 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.
