---
id: TST-ACC-BAT-112
title: Batch integration unpost deletes 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/posting/unpost-deletes-entries.integration.spec.js
implements:
  - ATS-ACC-BAT-016-02
  - ATS-ACC-BAT-016-05
  - ATS-ACC-BAT-016-06
  - ATS-ACC-BAT-017-03
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-016-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#deletes
      the batch’s entries and their lines, and tells how many entries
  - scenario: ATS-ACC-BAT-016-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#leaves
      the other batch’s entries and lines untouched
  - scenario: ATS-ACC-BAT-016-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#keeps
      the posting history: the first posting reversed, the second current
  - scenario: ATS-ACC-BAT-016-05
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#writes
      one fresh set when the batch is posted again, equal in size to the first
  - scenario: ATS-ACC-BAT-016-05
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#lists,
      history included, only the fresh set after the repost: no stale entry, no
      reversal
  - scenario: ATS-ACC-BAT-016-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#refuses
      (RHA02) a posting that holds a reversal entry, and keeps the reversal line
      marked is_reversal
  - scenario: ATS-ACC-BAT-016-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#refuses
      (RHA02) a posting that is already reversed
  - scenario: ATS-ACC-BAT-016-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#refuses
      (RHA02) a posting of another tenant
  - scenario: ATS-ACC-BAT-017-03
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#is
      the only way to delete a ledger row: the application role is refused a
      direct delete
evidence:
  - provenance: observed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-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/posting/unpost-deletes-entries.integration.spec.js#suite
      header
    note: >-
      Real: PostgreSQL, the posting engine, the persistence services and the
      definer function. Doubled: nothing.
unbound_scope: null
---

# Batch integration unpost deletes 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

Ordinary recovery removes its own entries and lines, preserves other collections and retains retired posting history. 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.
