---
id: TST-ACC-BAT-086
title: Batch integration batches.queries
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/batches.queries.integration.spec.js
implements:
  - ATS-ACC-BAT-002-02
  - ATS-ACC-BAT-002-05
  - ATS-ACC-BAT-002-06
  - ATS-ACC-BAT-005-01
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-002-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#lists
      a unit’s batches by date, then id
  - scenario: ATS-ACC-BAT-002-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#lists
      a unit’s batches of one status
  - scenario: ATS-ACC-BAT-002-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#lists
      a fiscal period’s batches
  - scenario: ATS-ACC-BAT-002-02
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#answers
      a page with more to follow, then the page after it
  - scenario: ATS-ACC-BAT-002-05
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#reads
      another tenant’s batch as absent
  - scenario: ATS-ACC-BAT-002-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#answers
      the posted and downloaded batches depending on those named, through
      others, with their id, name, date and status
  - scenario: ATS-ACC-BAT-002-06
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#answers
      none for a batch nothing depends on
  - scenario: ATS-ACC-BAT-005-01
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#answers
      the optional properties a batch states: its code, description, automatic
      close and its schedule
evidence:
  - provenance: observed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.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/batches.queries.integration.spec.js#suite
      header
    note: >-
      Real: PostgreSQL, the persistence service, the mapper, the execution
      context and its transactions under `rhythm_accounting_app`.
  - provenance: documented
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.queries.integration.spec.js#suite
      header
    note: >-
      Doubled: nothing. Never doubled: the statements, the mapper or row-level
      security.
unbound_scope: null
---

# Batch integration batches.queries

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

Batch retrieval, filtering, pagination, workspace absence and downstream dependency lookup are checked against persisted collections. 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.
