---
id: TST-ACC-TRX-058
title: Locked invoice 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/locked-invoice.integration.spec.js
implements:
  - ATS-ACC-TRX-002-09
implements_parts:
  - scenario: ATS-ACC-TRX-002-09
    assertion: >-
      it refuses the issue, the details change and the delete of the draft, each
      in the configuration module’s words
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/locked-invoice.integration.spec.js#it
      refuses the issue, the details change and the delete of the draft, each in
      the configuration module’s words
  - scenario: ATS-ACC-TRX-002-09
    assertion: 'it refuses the void of the issued invoice, which stays open'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/locked-invoice.integration.spec.js#it
      refuses the void of the issued invoice, which stays open
  - scenario: ATS-ACC-TRX-002-09
    assertion: 'it refuses the delete, and lets the details change through'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/locked-invoice.integration.spec.js#it
      refuses the delete, and lets the details change through
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/locked-invoice.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/locked-invoice.integration.spec.js
    assertion_titles:
      - a locked invoice (integration)
      - locked against updates and deletes
      - >-
        refuses the issue, the details change and the delete of the draft, each
        in the configuration module’s words
      - >-
        leaves the draft as it was: a draft, unnumbered, its memo unchanged, its
        version untouched
      - 'refuses the void of the issued invoice, which stays open'
      - 'answers the lock on the invoice, for the actions to judge'
      - locked against deletes alone
      - 'refuses the delete, and lets the details change through'
    imports:
      - const chai = require('chai');
      - chai.use(require('chai-as-promised'));
      - 'const { sql } = require(''drizzle-orm'');'
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { updateDetails, voidInvoice } =
        require('../../../../services/invoices/invoice-changes');
      - >-
        const { createDraft, deleteDraft } =
        require('../../../../services/invoices/invoice-drafts');
      - >-
        const { issueInvoice } =
        require('../../../../services/invoices/invoice-issue');
      - >-
        const { getInvoice } =
        require('../../../../services/invoices/invoice-reads');
      - '} = require(''../../invoices-fixtures'');'
      - "\t\t\tconst { frozen } = seeded.require();"
      - "\t\t\tconst { frozen } = seeded.require();"
      - "\t\t\tconst { issued } = seeded.require();"
      - "\t\t\tconst { frozen, issued } = seeded.require();"
      - "\t\t\tconst { kept } = seeded.require();"
    test_double_declarations: []
---

# Locked invoice 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 protection controls allowed invoice changes. 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.
