---
id: TST-ACC-BAT-069
title: Batch integration post system batch
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/close/post-system-batch.integration.spec.js
implements:
  - ATS-ACC-BAT-020-01
  - ATS-ACC-BAT-020-02
  - ATS-ACC-BAT-020-06
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-020-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#writes
      the batch already posted, in the period, named and dated as given
  - scenario: ATS-ACC-BAT-020-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#answers
      the same batch and posting, not created
  - scenario: ATS-ACC-BAT-020-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#is
      refused with other entries (`event_key_reused`)
  - scenario: ATS-ACC-BAT-020-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#posts
      the same batch again under the new key
  - scenario: ATS-ACC-BAT-020-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#stores
      the second posting's entries under the caller's ids suffixed `-2`
  - scenario: ATS-ACC-BAT-020-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
      unbalanced entries (`entry_unbalanced`)
  - scenario: ATS-ACC-BAT-020-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
      no entries (`entries_required`)
  - scenario: ATS-ACC-BAT-020-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
      a date outside the period
  - scenario: ATS-ACC-BAT-020-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
      a new key while the batch is posted (`system_batch_posted`)
  - scenario: ATS-ACC-BAT-020-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
      a name another batch of the unit has (`name_in_use`)
evidence:
  - provenance: observed
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.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/close/post-system-batch.integration.spec.js#suite
      header
    note: >-
      Real: the integration database, the configuration services, the close
      functions and the persistence services, and the close job's
  - provenance: documented
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#suite
      header
    note: >-
      `set_period_status`, which moves the periods' statuses
      (`support/close-world.js`, `setPeriodStatus`). Doubled: nothing.
unbound_scope: null
---

# Batch integration post system batch

## 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

Fiscal entries, repeated event identity, changed replay refusal and re-close are checked against one system collection per period and type. 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.
