Skip to content

CAP-ACC-BAT-005Arrange automatic close and posting

Markdown

CAP-ACC-BAT-005

Arrange automatic close and posting

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaAccountingModuleBatch ManagementRevision1

Read atservices-accounting f47cb263react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Scheduled retirement records whether closing and posting preparation could proceed.
Surfaces
consoleapijob
Constraints
Occurrence handling checks the current batch state when delivery is repeated.
Intent sources
services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew, 2026-10-16)

Controls

27 controls apply, from the corpus control catalogue.

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

Permissions

KeyChecked atScope
accounting.batches.createapitenant
accounting.batches.updateapitenant

Business Rules

7 rules, 7 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
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.
policyapi, servicetest
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
02must prove
Proposed
The scheduled close acts only on an existing Open batch and skips a missing batch or one whose state has changed.
lifecycleservicetest
03must prove
Proposed
After closing, scheduled work prepares the posting request in the same transaction and starts the job after commit.
origin: services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew, 2026-10-16)
lifecycleservicetest
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)
04must prove
Proposed
Redelivery of a completed close occurrence creates no additional close or posting.
origin: services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew, 2026-10-16)
invariantservicetest
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
05must prove
Proposed
Manual close, archive or removal of the close time cancels the automatic close, and deletion removes its schedule.
lifecycleservicetest
06must prove
Proposed
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.
origin: services-accounting:docs/migrations/transaction-processing/batches/README.md#D13: automatic posting (Andrew, 2026-10-16)
policyserviceobserved
07must prove
Proposed
The product should reject an automatic close time earlier than the current time.
validationapiunknown

Scenarios

IdGivenWhenThenProvenance
01Staff arrange a late-afternoon automatic close for the daily batch.The scheduled occurrence is handled.The work closes the batch and prepares automatic posting.observed
02Staff archive a batch before its automatic-close time.That previously selected time arrives.The cancelled schedule produces no automatic close.test
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

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.