---
id: TST-ACC-TRX-072
title: Customer guard 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/payments/customer-guard.integration.spec.js
implements:
  - ATS-ACC-TRX-008-02
implements_parts:
  - scenario: ATS-ACC-TRX-008-02
    assertion: >-
      it refuses receiving a payment with an allocation to another customer’s
      invoice, naming it plainly
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/payments/customer-guard.integration.spec.js#it
      refuses receiving a payment with an allocation to another customer’s
      invoice, naming it plainly
  - scenario: ATS-ACC-TRX-008-02
    assertion: >-
      it refuses allocating unapplied money to another customer’s invoice,
      leaving the payment unapplied
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/payments/customer-guard.integration.spec.js#it
      refuses allocating unapplied money to another customer’s invoice, leaving
      the payment unapplied
  - scenario: ATS-ACC-TRX-008-02
    assertion: >-
      it refuses reallocating money onto another customer’s invoice, keeping the
      allocation it would have reversed
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/payments/customer-guard.integration.spec.js#it
      refuses reallocating money onto another customer’s invoice, keeping the
      allocation it would have reversed
  - scenario: ATS-ACC-TRX-008-02
    assertion: it refuses a card payment planned against another customer’s invoice
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/payments/customer-guard.integration.spec.js#it
      refuses a card payment planned against another customer’s invoice
  - scenario: ATS-ACC-TRX-008-02
    assertion: it accepts the payment’s own customer’s invoice
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/payments/customer-guard.integration.spec.js#it
      accepts the payment’s own customer’s invoice
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/payments/customer-guard.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/payments/customer-guard.integration.spec.js
    assertion_titles:
      - a payment and another customer’s invoice (integration)
      - >-
        refuses receiving a payment with an allocation to another customer’s
        invoice, naming it plainly
      - refuses a card payment planned against another customer’s invoice
      - >-
        refuses allocating unapplied money to another customer’s invoice,
        leaving the payment unapplied
      - accepts the payment’s own customer’s invoice
      - >-
        refuses reallocating money onto another customer’s invoice, keeping the
        allocation it would have reversed
    imports:
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { allocatePayment, reallocatePayment } =
        require('../../../../services/payments/payment-allocate');
      - >-
        const { receivePayment } =
        require('../../../../services/payments/payment-receive');
      - 'const { ACME } = require(''../../invoices-fixtures'');'
      - '} = require(''../../payments-fixtures'');'
      - "\t\tconst { acmes } = world.require();"
      - "\t\tconst { acmes } = world.require();"
      - "\t\tconst { acmes, check } = world.require();"
      - "\t\tconst { adas, check } = world.require();"
      - "\t\tconst { check } = world.require();"
      - "\t\tconst { acmes, check } = world.require();"
      - "\t\tconst [live] = own.require().allocations;"
    test_double_declarations: []
---

# Customer guard 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 customer eligibility applies across allocation paths. 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.
