---
id: CAP-ACC-BAT-005
title: Arrange automatic close and posting
feature: FEAT-ACC-BAT-01
product_area: accounting
module: batches
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
- inventory CAP-ACC-BAT-003
- inventory RUL-ACC-BAT-006
- inventory RUL-ACC-BAT-008
- journey ACT-ACC-0507
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
- 'services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew,
  2026-10-16)'
purpose: A scheduled close keeps routine posting moving without a staff member initiating each run.
outcomes:
- Scheduled retirement records whether closing and posting preparation could proceed.
concepts:
- CON-ACC-BAT-001
- CON-ACC-BAT-003
actors:
- ACT-ACC-012
- ACT-ACC-014
surfaces:
- console
- api
- job
permissions:
- key: accounting.batches.create
  where_checked: api
  scope: tenant
- key: accounting.batches.update
  where_checked: api
  scope: tenant
rules:
- id: BR-CAP-ACC-BAT-005-01
  proved_by: [ATS-ACC-BAT-001-12, ATS-ACC-BAT-005-01, ATS-ACC-BAT-005-06, TST-ACC-BAT-085, TST-ACC-BAT-086]
  statement: An Open batch can schedule its close using an offset-bearing instant or a date interpreted as local
    midnight, with one occurrence at that local minute.
  kind: policy
  enforced_at:
  - api
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#keeps
    a one-occurrence schedule of the batch at that minute, in the tenant’s zone
  origin: none
- id: BR-CAP-ACC-BAT-005-02
  proved_by: [ATS-ACC-BAT-005-02, TST-ACC-BAT-085]
  statement: The scheduled close acts only on an existing Open batch and skips a missing batch or one whose state
    has changed.
  kind: lifecycle
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#skips
    a run whose batch is no longer open
  origin: none
- id: BR-CAP-ACC-BAT-005-03
  proved_by: [ATS-ACC-BAT-005-03, ATS-ACC-BAT-005-10, ATS-ACC-BAT-013-16, TST-ACC-BAT-085]
  statement: After closing, scheduled work prepares the posting request in the same transaction and starts the job
    after commit.
  kind: lifecycle
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#submits
    one posting job of the closed batch, in its unit, for the tenant’s customer (D13)
  origin: 'services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew,
    2026-10-16)'
- id: BR-CAP-ACC-BAT-005-04
  proved_by: [ATS-ACC-BAT-005-03, ATS-ACC-BAT-005-09, ATS-ACC-BAT-010-10, TST-ACC-BAT-085]
  statement: Redelivery of a completed close occurrence creates no additional close or posting.
  kind: invariant
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: 'services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#posts
    nothing more when the same occurrence runs again: the batch is no longer open'
  origin: 'services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew,
    2026-10-16)'
- id: BR-CAP-ACC-BAT-005-05
  proved_by: [ATS-ACC-BAT-003-13, ATS-ACC-BAT-004-10, ATS-ACC-BAT-005-04, ATS-ACC-BAT-005-07, ATS-ACC-BAT-005-08, TST-ACC-BAT-085]
  statement: Manual close, archive or removal of the close time cancels the automatic close, and deletion removes
    its schedule.
  kind: lifecycle
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#removes
    the schedule and the time when the batch is closed
  origin: none
- id: BR-CAP-ACC-BAT-005-06
  proved_by: [ATS-ACC-BAT-005-05]
  statement: If posting preparation after a completed close is refused, the batch remains Closed and the run explains
    the refusal; document-generation errors in a subsequent posting can leave it in Error.
  kind: policy
  enforced_at:
  - service
  must_prove: true
  provenance: observed
  source: services-accounting:modules/batches/services/auto-post/automatic-posting.ts:prepareAutomaticPosting
  origin: 'services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew,
    2026-10-16)'
- id: BR-CAP-ACC-BAT-005-07
  proved_by: [ATS-ACC-BAT-005-11]
  statement: The product should reject an automatic close time earlier than the current time.
  kind: validation
  enforced_at:
  - api
  must_prove: true
  provenance: unknown
  source: FND-ACC-BAT-005
  origin: none
scenarios:
- id: SC-CAP-ACC-BAT-005-01
  given: Staff arrange a late-afternoon automatic close for the daily batch.
  when: The scheduled occurrence is handled.
  then: The work closes the batch and prepares automatic posting.
  provenance: observed
  source: services-accounting:modules/batches/services/persistence/batches.ts:closeBatchOnSchedule; services-accounting:modules/batches/services/auto-post/automatic-posting.ts:prepareAutomaticPosting
- id: SC-CAP-ACC-BAT-005-02
  given: Staff archive a batch before its automatic-close time.
  when: That previously selected time arrives.
  then: The cancelled schedule produces no automatic close.
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#drops
    an archived batch’s automatic close, as an automatic close is kept only on an open batch
edge_cases: []
constraints:
- Occurrence handling checks the current batch state when delivery is repeated.
depends_on:
- CAP-ACC-BAT-001
- CAP-ACC-BAT-013
related:
- CAP-ACC-BAT-003
- CAP-ACC-BAT-010
journeys: []
open_questions: []
evidence:
- 'Pinned services-accounting (f47cb263), examined sources: services/rules/batch-rules.ts (autoCloseOf, autoCloseInstantOf,
  BATCH_AUTO_CLOSE_WORK_KIND), services/persistence/batches.ts (insertBatch, changeBatch, syncAutoCloseSchedule,
  closeBatchOnSchedule), services/auto-close/batch-auto-close.ts, services/auto-post/automatic-posting.ts; tests
  integration/services/persistence/batches.integration.spec.js ("the automatic close"); unit/carried/batches/object/cleaning.spec.js;
  docs/migrations/transaction-processing/batches/README.md (D13).'
- 'Pinned react-console (baf6dae3), examined sources: components/accounting/batches/auto-close-field.tsx, new-batch-screen.tsx,
  edit-batch-sheet.tsx; journeys ACT-ACC-0501, 0504, 0507.'
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-DAT-001, TC-DAT-004, TC-LOG-004, TC-LOG-005, TC-AVL-001, TC-AVL-004, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005]
exercised_by: [FAS-ACC-BAT-01-03]
suites: [TST-ACC-BAT-085, TST-ACC-BAT-086]
---

# Arrange automatic close and posting

## Purpose

A scheduled close keeps routine posting moving without a staff member initiating each run.

## How It Works

Staff set an automatic-close date and time while working with an Open batch. Rhythm retains a schedule for that occurrence. Scheduled work checks the batch again before acting. A successful close prepares automatic posting and starts it after commit. If preparation is refused, the recorded outcome explains why the closed batch still needs attention. A later batch change can cancel the schedule before it runs.

## Relationships

- Prerequisite: Collect a business unit’s documents in a new batch, which addresses the connected batch work.
- Prerequisite: Run and monitor a batch posting job, which addresses the connected batch work.
- Related outcome: Correct batch details before posting, which addresses the connected batch work.
- Related outcome: Advance a scheduled stream and post its predecessor, which addresses the connected batch work.
