---
id: TST-ACC-BAT-093
title: Batch integration subledger entries
kind: integration
product_area: accounting
module: batches
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - >-
    modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js
implements:
  - ATS-ACC-BAT-017-01
  - ATS-ACC-BAT-017-03
  - ATS-ACC-BAT-017-04
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  The suite owns its test workspace or fixed integration fixtures in the
  prepared local database.
assertion_sources:
  - scenario: ATS-ACC-BAT-017-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#writes
      a balanced entry, and lists it under its posting
  - scenario: ATS-ACC-BAT-017-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#refuses
      an entry whose debits and credits differ, at commit, by the balance
      constraint
  - scenario: ATS-ACC-BAT-017-03
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#cannot
      be updated by the application role, which holds no UPDATE on the table
  - scenario: ATS-ACC-BAT-017-03
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#cannot
      be deleted by the application role, which holds no DELETE on the table
  - scenario: ATS-ACC-BAT-017-03
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#cannot
      be updated even by the table owner: the append-only trigger refuses it,
      naming the table
  - scenario: ATS-ACC-BAT-017-04
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#refuses
      a line whose G/L account belongs to another business unit, by the
      same-unit foreign key
  - scenario: ATS-ACC-BAT-017-04
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#refuses
      a second entry of the same transaction in the same posting, by the
      no-duplicates key
  - scenario: ATS-ACC-BAT-017-04
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#refuses
      a reversing entry that names no entry of its tenant, by the reversal
      trigger
evidence:
  - provenance: observed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js
    note: >-
      The executable file is inspected at the pinned revision; duration is an
      unmeasured planning estimate.
  - provenance: documented
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.integration.spec.js#suite
      header
    note: >-
      Real: the integration database, the persistence services and the mapping
      of the 1.0 entry document (`legacy/adapters/documents.ts`).
unbound_scope: null
---

# Batch integration subledger entries

## Verification Boundary

This suite exercises the imported batch services or storage against the prepared local database. It does not imply that a deployed workflow is contacted.

## What This Suite Proves

Entry balance, account boundaries, immutable rows, duplicate identities and guarded removal are checked at persistence. The assertion anchors identify the supported portions of the bound scenarios.

## What It Does Not Prove

Local assertions do not establish deployment configuration, remote delivery guarantees, or unasserted lifecycle and concurrency paths.

## Real Dependencies and Test Doubles

PostgreSQL and the exercised persistence or accounting functions are real. Controlled clocks, imported test fixtures and any suite-specific doubles delimit the asserted behavior.

## Must Not Be Doubled

The database constraints, transaction boundaries and exercised accounting functions must remain real when qualifying the asserted persistence or generation behavior.
