---
id: TST-ACC-TRX-040
title: Document 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/document-refusals.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/document-refusals.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/document-refusals.integration.spec.js
    assertion_titles:
      - the memo and write-off refusals (integration)
      - a void invoice
      - >-
        refuses a credit memo, a debit memo and a write-off 409
        invoice_not_draft
      - says the invoice is void
      - an issued pro forma whose receivable is not recognized
      - >-
        refuses a credit memo and a write-off 409 invoice_not_draft, saying to
        convert it first
      - the dates
      - >-
        refuses an accounting date no fiscal period covers 409 period_not_open,
        for a memo and for a write-off
      - >-
        refuses a memo dated before its invoice’s accounting date, 400 in a
        plain sentence
      - >-
        refuses a write-off dated before its invoice’s accounting date the same
        way
      - the amounts
      - >-
        refuses a line in another currency than the invoice’s 400
        currency_mismatch, for a memo and for a write-off
      - 'refuses an amount that is not greater than zero, 400 naming the line'
      - a write-off’s method and account
      - 'refuses a direct write-off naming an allowance account, 400'
      - >-
        refuses an allowance write-off naming an account the tenant has not
        (not_found)
      - a write-off’s batch
      - refuses another unit’s batch 409 batch_not_open
      - refuses a batch the tenant has not 404 not_found
      - >-
        refuses no batch in a unit without batch assignment settings 409
        batch_required
      - an invoice the tenant does not have
      - is refused a write-off 404 not_found
      - after every refusal
      - >-
        holds exactly the rows it held before: no memo, no write-off, no ledger
        line, no fact, no event was written
    imports:
      - 'const { expect } = require(''chai'');'
      - >-
        const { uuidV7 } =
        require('@rhythmsoftware/macroservice-records/uuid-v7');
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { ready, testId } =
        require('../../../../books/tests/integration/support');
      - >-
        const { createCreditMemo, createDebitMemo } =
        require('../../../services/change-memos/memo-commands');
      - >-
        const { createWriteOff } =
        require('../../../services/write-offs/write-off-commands');
      - >-
        const { voidInvoice } =
        require('../../../services/invoices/invoice-changes');
      - >-
        const { issueInvoice } =
        require('../../../services/invoices/invoice-issue');
      - '} = require(''../memos-fixtures'');'
      - "\t\t\tconst { voided } = world.require();"
      - "\t\t\tconst { voided } = world.require();"
      - "\t\t\tconst { proForma } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tconst { issued } = world.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tconst { counts } = world.require();"
    test_double_declarations: []
---

# Document 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

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.
