---
id: TST-ACC-TRX-111
title: Remittance refusals 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/remittances/remittance-refusals.integration.spec.js
implements:
  - ATS-ACC-TRX-010-02
  - ATS-ACC-TRX-010-03
  - ATS-ACC-TRX-010-04
implements_parts:
  - scenario: ATS-ACC-TRX-010-02
    assertion: >-
      it refuses a total that is not the lines plus the remainder, writing
      nothing: remittance_total_mismatch
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses a total that is not the lines plus the remainder, writing nothing:
      remittance_total_mismatch
  - scenario: ATS-ACC-TRX-010-02
    assertion: >-
      it refuses a remainder left unstated: the total of 200.00 over a line of
      180.00 is a mismatch, not an inferred remainder
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses a remainder left unstated: the total of 200.00 over a line of
      180.00 is a mismatch, not an inferred remainder
  - scenario: ATS-ACC-TRX-010-03
    assertion: 'it refuses a card method: remittance_method_not_offline'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses a card method: remittance_method_not_offline
  - scenario: ATS-ACC-TRX-010-03
    assertion: 'it refuses a paper check without its number: payment_reference_required'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses a paper check without its number: payment_reference_required
  - scenario: ATS-ACC-TRX-010-04
    assertion: 'it refuses an invoice that is not open (paid): remittance_invoice_not_open'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses an invoice that is not open (paid): remittance_invoice_not_open
  - scenario: ATS-ACC-TRX-010-04
    assertion: 'it refuses an invoice in another currency: currency_mismatch'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses an invoice in another currency: currency_mismatch
  - scenario: ATS-ACC-TRX-010-04
    assertion: >-
      it refuses a line whose stated bill-to is not its invoice’s:
      business_unit_mismatch
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses a line whose stated bill-to is not its invoice’s:
      business_unit_mismatch
  - scenario: ATS-ACC-TRX-010-04
    assertion: it refuses an invoice named twice
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses an invoice named twice
  - scenario: ATS-ACC-TRX-010-04
    assertion: >-
      it refuses a line for more than its invoice owes after another bill-to’s
      payment was made, rolling that payment back too: over_application
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js#it
      refuses a line for more than its invoice owes after another bill-to’s
      payment was made, rolling that payment back too: over_application
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/remittances/remittance-refusals.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/remittances/remittance-refusals.integration.spec.js
    assertion_titles:
      - recordRemittance refusals and tenant isolation (integration)
      - >-
        refuses a total that is not the lines plus the remainder, writing
        nothing: remittance_total_mismatch
      - >-
        refuses a remainder left unstated: the total of 200.00 over a line of
        180.00 is a mismatch, not an inferred remainder
      - 'refuses a card method: remittance_method_not_offline'
      - 'refuses a paper check without its number: payment_reference_required'
      - 'refuses an invoice that is not open (paid): remittance_invoice_not_open'
      - 'refuses an invoice in another currency: currency_mismatch'
      - >-
        refuses a line whose stated bill-to is not its invoice’s:
        business_unit_mismatch
      - >-
        refuses a line for more than its invoice owes after another bill-to’s
        payment was made, rolling that payment back too: over_application
      - refuses an invoice named twice
      - another tenant
      - 'reads no remittance of this tenant’s: 404'
      - 'cannot name this tenant’s invoice: 404'
      - >-
        sees no row of either table under row-level security, where this tenant
        sees its own
      - >-
        names the remitter Metro Transit from CRM when the request gives no name
        (premise of the refusals’ world)
    imports:
      - 'const { sql } = require(''drizzle-orm'');'
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { getRemittance, recordRemittance } =
        require('../../../../services/remittances/remittance-commands');
      - >-
        const { receivePayment } =
        require('../../../../services/payments/payment-receive');
      - '} = require(''../../remittances-fixtures'');'
      - "\t\tconst { b } = world.require();"
      - "\t\tconst { b } = world.require();"
      - "\t\tconst { b } = world.require();"
      - "\t\tconst { b } = world.require();"
      - "\t\tconst { paid } = world.require();"
      - "\t\tconst { eur } = world.require();"
      - "\t\tconst { b } = world.require();"
      - "\t\tconst { b, c } = world.require();"
      - "\t\tconst { b } = world.require();"
      - "\t\t\tconst { remittance } = world.require();"
      - "\t\t\tconst { b } = world.require();"
      - "\t\tconst { remittance } = world.require();"
    test_double_declarations: []
---

# Remittance refusals 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 unstated excess is a total mismatch; remittance method must be offline and valid; invalid member lines roll back the receipt. 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.
