---
id: TST-ACC-TRX-145
title: Invoice document data suite
kind: unit
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/transactions/tests/unit/rules/invoice-document-data.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: 1
isolation: In-memory fixtures and test-controlled collaborators.
provenance: test
source: >-
  services-accounting:modules/transactions/tests/unit/rules/invoice-document-data.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/unit/rules/invoice-document-data.spec.js
    assertion_titles:
      - the invoice document data
      - invoiceDocumentData
      - >-
        maps the invoice, its lines, its parties and its last payment onto the
        declared variables
      - >-
        names the last payment’s method as a person reads it when its name is
        known (WP-01), else by its id
      - >-
        is exactly the invoice templates’ declared variables (no problem from
        the shared validator)
      - >-
        is still the declared variables with every optional value absent, an
        organization’s invoice
      - >-
        names a draft’s line product from the products module when the issue has
        not snapshotted it, and its number null
      - >-
        makes minor units major by the currency’s exponent: cents for USD, none
        for JPY, three for KWD
      - reads an address without a first line as no address
      - latestPaymentOf
      - >-
        answers the latest payment by date (RS-2589), the higher number of two
        on one day
      - withPublicPaymentLink (RB-1650)
      - >-
        appends 1.0’s link, its div left open as 1.0 wrote it, when the HTML
        does not show it
      - leaves HTML that already shows the link as it is
      - leaves HTML that carries the suppression marker as it is
      - leaves the HTML as it is when the invoice has no link
      - htmlBodyOfMessage
      - escapes the message and keeps its paragraphs and line breaks
    imports:
      - 'const { expect } = require(''chai'');'
      - >-
        const { validateVariables } =
        require('@rhythmsoftware/macroservice-communications/template-variables');
      - >-
        const { INVOICE_VARIABLES } =
        require('../../../../books/services/document-templates/variables');
      - '} = require(''../../../services/invoices/invoice-document-data'');'
    test_double_declarations: []
---

# Invoice document data suite

## Verification Boundary

The suite exercises financial calculations and input contracts in an isolated test process. 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

Pure calculations and doubled collaborators do not establish database persistence, route authorization or deployed behavior. An unbound feature chain remains proposed, and this registration carries no execution result.

## Real Dependencies and Test Doubles

The imported calculation or contract runs with the fixtures and collaborators declared by the test. The evidence register retains those declarations so the boundaries can be inspected.

## Must Not Be Doubled

The calculation or contract being asserted must remain real; replacing it with a predetermined result removes this suite’s evidence.
