---
id: TST-ACC-TRX-098
title: Receivable events queries 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/persistence/receivable-events.queries.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/persistence/receivable-events.queries.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/persistence/receivable-events.queries.integration.spec.js
    assertion_titles:
      - 'the receivable facts: reads (integration)'
      - listOpenItemsAsOf
      - >-
        answers each item’s balance and its latest attributes as of the date,
        known at the instant, leaving out a zero balance and a later date
      - takes the attributes of an earlier date from the facts effective by then
      - sees the fact recorded a day late once the instant is after it
      - >-
        does not see the fact recorded after the instant, whatever its business
        date (FC-07)
      - answers another tenant only its own items
      - answers nothing before the first fact’s date
      - sumReceivableEventsAsOf
      - >-
        sums the facts per currency with each currency’s exponent, a balance of
        zero kept
      - bounds the sum by the business date
      - bounds the sum by the knowledge instant
      - listReceivableEvents
      - >-
        lists the item’s facts in effect order: business date, then recording
        instant
      - maps every column of a fact
      - answers nothing for an item with no facts
    imports:
      - >-
        const { fixedClock } =
        require('@rhythmsoftware/macroservice-time/clock');
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - '} = require(''../../../../services/persistence/receivable-events'');'
      - >-
        const { ctxIn, expect, fixedIn, ready, removeTenantInvoices, testId } =
        require('../../invoices-fixtures');
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\tfacts.require();"
      - "\t\t\t\tlisting.require().map((row) => [row.event_type, row.accounting_date, row.open_item_line_id, row.amount, row.sys_recorded_at]),"
      - "\t\t\tconst [first] = listing.require();"
      - "\t\t\tfacts.require();"
    test_double_declarations: []
---

# Receivable events queries 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.
