---
id: TST-ACC-BAT-060
title: Batch API batches
kind: api-lifecycle
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/e2e/batches.e2e.spec.js
implements:
  - ATS-ACC-BAT-001-01
  - ATS-ACC-BAT-001-06
  - ATS-ACC-BAT-001-09
  - ATS-ACC-BAT-001-10
  - ATS-ACC-BAT-002-01
  - ATS-ACC-BAT-002-02
  - ATS-ACC-BAT-002-06
  - ATS-ACC-BAT-003-01
  - ATS-ACC-BAT-003-07
  - ATS-ACC-BAT-004-01
  - ATS-ACC-BAT-006-02
  - ATS-ACC-BAT-009-05
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-001-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a create naming the status 400: a new batch is always open
  - scenario: ATS-ACC-BAT-001-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#creates
      the batch: 200, an id of faa’s prefix, the fiscal period of today, faa’s
      base currency, open
  - scenario: ATS-ACC-BAT-001-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a create without a name 400, naming the field
  - scenario: ATS-ACC-BAT-001-09
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a create to a caller without accounting.batches.create 403
  - scenario: ATS-ACC-BAT-001-10
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a create naming another tenant in the body 400
  - scenario: ATS-ACC-BAT-002-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#lets a
      caller with accounting.batches.read list
  - scenario: ATS-ACC-BAT-002-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a fiscal_period filter without its fiscal_year_id 400
  - scenario: ATS-ACC-BAT-002-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a dependents request naming no batch 400
  - scenario: ATS-ACC-BAT-003-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      a PATCH naming the status 400: a status changes only through the batch’s
      actions
  - scenario: ATS-ACC-BAT-003-07
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#renames
      it at the version read
  - scenario: ATS-ACC-BAT-004-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#closes
      it, then reopens it
  - scenario: ATS-ACC-BAT-004-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses
      closing it again 409
  - scenario: ATS-ACC-BAT-006-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#deletes
      it, and then reads it 404
  - scenario: ATS-ACC-BAT-009-05
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#answers
      the recurring batch’s first batch as its active batch: open, named for
      today, of the recurring batch
evidence:
  - provenance: observed
    source: 'services-accounting:modules/batches/tests/e2e/batches.e2e.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/e2e/batches.e2e.spec.js#suite
      header
    note: >-
      Real: the composed handler (the dispatcher, the tenant access gate, the
      application access and licence steps), the routes, the
  - provenance: documented
    source: >-
      services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#suite
      header
    note: >-
      security). Doubled: the signing key pair, which is the run's own. Every
      call acts in a tenant of the spec's own (`testId`),
unbound_scope: null
---

# Batch API batches

## Verification Boundary

This suite invokes the composed Accounting dispatcher locally against the prepared database. It exercises request mapping, declared authorization checks and the asserted persistence results.

## What This Suite Proves

The assertions exercise batch api batches with controlled case inputs and compare permitted outcomes with their recorded refusals. 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.
