---
id: TST-ACC-TRX-041
title: Integration events 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/integrations/integration-events.integration.spec.js
implements:
  - ATS-ACC-TRX-020-08
implements_parts:
  - scenario: ATS-ACC-TRX-020-08
    assertion: >-
      it records every event it handles or ignores by id in the handling
      transaction, and a replay is ignored by the row, not by a lookup
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it
      records every event it handles or ignores by id in the handling
      transaction, and a replay is ignored by the row, not by a lookup
  - scenario: ATS-ACC-TRX-020-08
    assertion: >-
      it ignores an event with no tenant, one of a tenant not known here, one
      about a payment that is not ours, and the payout kinds
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it
      ignores an event with no tenant, one of a tenant not known here, one about
      a payment that is not ours, and the payout kinds
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/integrations/integration-events.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js
    assertion_titles:
      - the integration events consumer (integration)
      - the consumed-event row (INV-29)
      - >-
        records every event it handles or ignores by id in the handling
        transaction, and a replay is ignored by the row, not by a lookup
      - >-
        writes no row for an event with no tenant or of a tenant not known here,
        which never reaches a handling transaction
      - what is ignored
      - >-
        ignores an event with no tenant, one of a tenant not known here, one
        about a payment that is not ours, and the payout kinds
      - payments.payment.updated
      - >-
        settles the one the event names succeeded, by its subject; a redelivery
        is ignored
      - >-
        returns the one the event names failed, found by the provider’s intent
        reference (the payment’s processor_intent_reference)
      - payments.refund.updated
      - >-
        finishes the processing refund with the provider’s reference, and a
        second delivery is ignored
      - disputes
      - >-
        opens a chargeback once per provider reference, then closes it lost: the
        payment charged back
    imports:
      - 'const { sql } = require(''drizzle-orm'');'
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { applyIntegrationEvents } =
        require('../../../../services/integrations/integration-events');
      - >-
        const { receivePayment } =
        require('../../../../services/payments/payment-receive');
      - >-
        const { executeRefund, requestRefund } =
        require('../../../../services/refunds/refund-commands');
      - '} = require(''../../payments-fixtures'');'
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tconst { clears } = pending.require();"
      - "\t\t\tconst { returns } = pending.require();"
      - "\t\t\tconst { payment, requested, refusal } = lost.require();"
      - "\t\t\tconst { payment } = disputed.require();"
    test_double_declarations: []
---

# Integration events 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 processor events are applied once by authorized routing. 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.
