---
id: TST-ACC-BAT-074
title: Batch integration system batch guard
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/system-batch-guard.integration.spec.js
implements:
  - ATS-ACC-BAT-003-09
  - ATS-ACC-BAT-004-07
  - ATS-ACC-BAT-006-05
  - ATS-ACC-BAT-007-01
  - ATS-ACC-BAT-010-03
  - ATS-ACC-BAT-011-07
  - ATS-ACC-BAT-016-07
  - ATS-ACC-BAT-020-07
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-003-09
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
      changing an ordinary batch’s type to a system type, the batch unchanged
  - scenario: ATS-ACC-BAT-004-07
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
      it in every action’s guard, with the system batch refusal
  - scenario: ATS-ACC-BAT-006-05
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
      delete 409 system_batch, the batch unchanged
  - scenario: ATS-ACC-BAT-007-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
      an invoice, a credit memo and a write-off naming the system batch (a
      transaction batch only, batch_not_open)
  - scenario: ATS-ACC-BAT-010-03
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#leaves
      the system batch as it is when a roll takes it out of service
  - scenario: ATS-ACC-BAT-011-07
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
      the system batch as a default batch (BA-12)
  - scenario: ATS-ACC-BAT-016-07
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#fails
      an unposting job naming the posted system batch, the batch left posted
  - scenario: ATS-ACC-BAT-020-07
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
      the action unpost of the posted system batch, submitting no job
evidence:
  - provenance: observed
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.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/system-batch-guard.integration.spec.js#suite
      header
    note: >-
      Real: the integration database, the configuration, products and batches
      services, the batch rule of the transactions module, the
  - provenance: documented
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#suite
      header
    note: >-
      posting jobs (inline runner), the native posting engine, the close
      functions and the batch actions. Doubled: the periods' status
unbound_scope: null
---

# Batch integration system batch guard

## 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 creation, modification, lifecycle and recovery operations refuse fiscal system collections without changing them. 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.
