---
id: TST-ACC-TRX-038
title: Customer summary 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/customers/customer-summary.integration.spec.js
implements:
  - ATS-ACC-TRX-017-01
  - ATS-ACC-TRX-017-03
  - ATS-ACC-TRX-017-06
implements_parts:
  - scenario: ATS-ACC-TRX-017-01
    assertion: >-
      it answers, as of today, its two open invoices (owing 9000), the overdue
      one (4000), the check’s 1000 unapplied, the 1500 credit, a net position of
      6500
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/customers/customer-summary.integration.spec.js#it
      answers, as of today, its two open invoices (owing 9000), the overdue one
      (4000), the check’s 1000 unapplied, the 1500 credit, a net position of
      6500
  - scenario: ATS-ACC-TRX-017-01
    assertion: >-
      it agrees with the aging’s as-of read for the customer: the same open
      items, the same amounts
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/customers/customer-summary.integration.spec.js#it
      agrees with the aging’s as-of read for the customer: the same open items,
      the same amounts
  - scenario: ATS-ACC-TRX-017-01
    assertion: >-
      it answers one row per currency, the EUR invoice as its own row where 1.0
      threw, in code order
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/customers/customer-summary.integration.spec.js#it
      answers one row per currency, the EUR invoice as its own row where 1.0
      threw, in code order
  - scenario: ATS-ACC-TRX-017-03
    assertion: >-
      it keeps the contact’s figures its own: Acme’s invoices are not counted in
      Ivy’s summary (1.0’s balances.js)
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/customers/customer-summary.integration.spec.js#it
      keeps the contact’s figures its own: Acme’s invoices are not counted in
      Ivy’s summary (1.0’s balances.js)
  - scenario: ATS-ACC-TRX-017-06
    assertion: >-
      it answers no currencies and no activity date for a customer with nothing
      open (1.0’s zero balance), and for a customer CRM does not know
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/customers/customer-summary.integration.spec.js#it
      answers no currencies and no activity date for a customer with nothing
      open (1.0’s zero balance), and for a customer CRM does not know
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/customers/customer-summary.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/customers/customer-summary.integration.spec.js
    assertion_titles:
      - the customer financial summary (integration)
      - a contact
      - >-
        answers, as of today, its two open invoices (owing 9000), the overdue
        one (4000), the check’s 1000 unapplied, the 1500 credit, a net position
        of 6500
      - >-
        dates the latest activity by the latest fact’s business date: the manual
        credit issued today
      - >-
        keeps the contact’s figures its own: Acme’s invoices are not counted in
        Ivy’s summary (1.0’s balances.js)
      - >-
        agrees with the aging’s as-of read for the customer: the same open
        items, the same amounts
      - an organization
      - >-
        answers one row per currency, the EUR invoice as its own row where 1.0
        threw, in code order
      - the party’s customer terms
      - >-
        answers the organization’s record beside its figures: approved,
        remitting for others, net 30
      - 'answers the defaults, saying so, for a contact without a record'
      - >-
        answers the defaults in another tenant for the party this tenant has
        terms for
      - 'nothing open, and another tenant'
      - >-
        answers no currencies and no activity date for a customer with nothing
        open (1.0’s zero balance), and for a customer CRM does not know
      - >-
        answers Ivy’s summary empty in the other tenant: row-level security
        hides the facts
    imports:
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { createCredit } =
        require('../../../../services/credits/credit-commands');
      - >-
        const { summarizeCustomer } =
        require('../../../../services/customers/customer-summary');
      - >-
        const { receivePayment } =
        require('../../../../services/payments/payment-receive');
      - >-
        const { listOpenItemsAsOf } =
        require('../../../../services/persistence/receivable-events');
      - >-
        const { putCustomerTerms } =
        require('../../../../services/persistence/customer-terms');
      - '} = require(''../../payments-fixtures'');'
      - 'const { putContact } = require(''../../parties-fixtures'');'
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tconst { acme_terms: acmeTerms } = world.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tworld.require();"
    test_double_declarations: []
---

# Customer summary 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 summary currency groups reconcile with open items; primary-organization payables differ from own summary; summary access and empty standing are distinct. 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.
