---
id: TST-ACC-TRX-050
title: Details 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/invoices/details.integration.spec.js
implements:
  - ATS-ACC-TRX-002-06
implements_parts:
  - scenario: ATS-ACC-TRX-002-06
    assertion: 'it changes the memo, the notes, the purchase order number and the template'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/details.integration.spec.js#it
      changes the memo, the notes, the purchase order number and the template
  - scenario: ATS-ACC-TRX-002-06
    assertion: it changes nothing else
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/details.integration.spec.js#it
      changes nothing else
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/invoices/details.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/details.integration.spec.js
    assertion_titles:
      - 'changeDueDate, changeTerms and updateDetails (integration)'
      - changeDueDate on an issued invoice
      - 'answers the new due date, the invoice still open'
      - >-
        appends an invoice_details_changed fact of amount 0 carrying the new due
        date, dated today
      - records the change_due_date document event
      - changeDueDate on a draft
      - answers the new due date
      - 'appends no fact, a draft having no receivable'
      - changeTerms on an issued invoice
      - was due thirty days after its date before (the premise)
      - >-
        recomputes the due date from the new terms: ten days after the invoice
        date
      - appends the fact carrying the new terms and due date
      - 'refuses terms the tenant has not (not_found), the invoice unchanged'
      - updateDetails on an issued invoice
      - 'changes the memo, the notes, the purchase order number and the template'
      - changes nothing else
      - leaves a field not sent as it is
      - 'appends no fact, the balance and the terms unchanged'
      - records an update_details document event per change
    imports:
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { createDraft } =
        require('../../../../services/invoices/invoice-drafts');
      - >-
        const { issueInvoice } =
        require('../../../../services/invoices/invoice-issue');
      - >-
        const { changeDueDate, changeTerms, updateDetails } =
        require('../../../../services/invoices/invoice-changes');
      - '} = require(''../../invoices-fixtures'');'
      - "\t\t\tworld.require();"
      - "\t\t\texpect([changing.require().due_date, changing.require().status]).to.deep.equal(['2026-03-15', 'open']);"
      - "\t\t\tconst facts = await receivableEventRowsOf(TENANT, changing.require().id);"
      - "\t\t\t\t['invoice_issued', '2026-01-10', changing.require().lines[0].id, '6000', '2026-02-09'],"
      - "\t\t\t\t['invoice_issued', '2026-01-10', changing.require().lines[1].id, '4000', '2026-02-09'],"
      - "\t\t\t\t(await documentEventRowsOf(TENANT, changing.require().id)).map((row) => [row.command, row.status_before, row.status_after]),"
      - "\t\t\tworld.require();"
      - "\t\t\texpect([changing.require().due_date, changing.require().status]).to.deep.equal(['2026-03-01', 'draft']);"
      - "\t\t\texpect(await receivableEventRowsOf(TENANT, changing.require().id)).to.deep.equal([]);"
      - "\t\t\tworld.require();"
      - "\t\t\texpect([changing.require().invoice.payment_terms_id, changing.require().invoice.due_date]).to.deep.equal(['net_30', '2026-02-09']);"
      - "\t\t\texpect([changing.require().changed.payment_terms_id, changing.require().changed.due_date]).to.deep.equal(['net_10', '2026-01-20']);"
      - "\t\t\tconst facts = await receivableEventRowsOf(TENANT, changing.require().invoice.id);"
      - "\t\t\tconst { changed } = changing.require();"
      - "\t\t\tworld.require();"
      - "\t\t\tconst { updated } = updating.require();"
      - "\t\t\tconst { invoice, updated } = updating.require();"
      - "\t\t\tconst { partly } = updating.require();"
      - "\t\t\tconst { invoice } = updating.require();"
      - "\t\t\tconst { invoice } = updating.require();"
    test_double_declarations: []
---

# Details 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 details update atomically. 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.
