---
id: TST-ACC-REC-052
title: Open and closed-period reversal
kind: integration
product_area: accounting
module: reconciliation
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js
implements:
  - ATS-ACC-REC-013-02
  - ATS-ACC-REC-013-03
  - ATS-ACC-REC-013-04
  - ATS-ACC-REC-013-05
  - ATS-ACC-REC-013-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: Suite-owned workspace fixtures and deterministic records removed by suite cleanup.
evidence:
  - >-
    services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js
bindings:
  - scenario: ATS-ACC-REC-013-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        an open batch
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#records
        the refusal as batch.reverse-refused
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        a second reversal under another key, naming the state (DEF-ACT-0596)
  - scenario: ATS-ACC-REC-013-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#answers
        the reversed batch whole
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#asks
        for the mirrors of the transfer and the fee, debits and credits swapped, in the unit’s batch on its
        date
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#releases
        its claims and payout link with the reason
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#records
        batch.reversed with its dates, batch and mirrors
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#reads
        the reversal on the reversed batch itself: reason, requester, approver and time (DEF-ACT-0594)
  - scenario: ATS-ACC-REC-013-04
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#records
        the request and leaves the batch finalized, awaiting a second approval
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#asks
        for no mirror yet
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#records
        batch.reversal-requested
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        a second request while one awaits approval
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        the requester’s own approval
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        an approval at a stale version
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        the approval: the batch its mirrors would ride in is in a closed period
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#leaves
        the reversal awaiting approval
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#answers
        the reversed batch with its approver
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#dates
        the mirrors on the November batch’s date, the original date their document date
  - scenario: ATS-ACC-REC-013-05
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#recognises
        the fee under its second key when a new batch reconciles it again
  - scenario: ATS-ACC-REC-013-06
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#refuses
        the reversal: no open batch takes its mirrors
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/reverse-batch.integration.spec.js#writes
        nothing: the batch finalized at its version, its claims held, no mirror, no event
---

# Open and closed-period reversal

## Verification Boundary

This suite calls production services over the real test database. Fixture setup may write records directly; the exercised commands and queries retain their normal database enforcement.

## What This Suite Proves

The executable assertions identified in the binding records supply the registered scenario observations. When a scenario names several suites, this suite supplies its listed assertions and does not independently establish every clause.

## What It Does Not Prove

Deployed infrastructure, live console behavior and shared scheduling delivery are outside this local boundary.

## Real Dependencies and Test Doubles

PostgreSQL, migrations and the exercised production code are real. Fixtures supply the financial world and caller context; deterministic setup and owner-side inspection do not replace database enforcement.

## Must Not Be Doubled

The exercised database constraints, transactional services and route enforcement remain real. Replacing them would remove the boundary this suite registers.
