Skip to content

CAP-ACC-BAT-001Collect a business unit’s documents in a new batch

Markdown

CAP-ACC-BAT-001

Collect a business unit’s documents in a new batch

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
Staff receive an identified collection in the appropriate unit and fiscal context.
Surfaces
consoleapi
Preconditions
The selected business unit has a fiscal calendar covering the requested date.
Postconditions
Creation leaves an Open batch available for eligible document intake.
Constraints
The unit’s configuration reference excludes hyphens, preserving an unambiguous prefix on generated batch references.
Intent sources
services-accounting:docs/migrations/transaction-processing/batches/README.md#Status as actions (job tp-batch-lifecycle, Andrew's UI brief of 2026-10-15)services-accounting:docs/migrations/transaction-processing/batches/README.md#D14 and migration 0060 (Andrew, 2026-10-16)

Controls

20 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-TEN-004 TC-DAT-001 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 TC-PI-005

Permissions

KeyChecked atScope
accounting.batches.createapitenant

Business Rules

10 rules, 10 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
Creation through the ordinary API starts a batch in Open and rejects any supplied status.
✓ A request with unit, date and name returns an Open batch.✗ Supplying Closed during creation fails without a write.
origin: services-accounting:docs/migrations/transaction-processing/batches/README.md#Status as actions (Andrew's UI brief of 2026-10-15)
validationapitest
services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses a create naming the status 400: a new batch is always open
02must prove
Proposed
Within a business unit, each batch name belongs to one batch; another unit can use the same name.
✓ Different units can both use the name Daily.✗ Reusing Daily within the same unit fails.
origin: services-accounting:docs/migrations/transaction-processing/batches/README.md#D14 and migration 0060 (Andrew, 2026-10-16)
validationservice, databasetest
services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#refuses a name another batch of the unit has 409, name_in_use, in 1.0’s sentence (D14)
03must prove
Proposed
The date determines the fiscal year and period, replacing submitted fiscal values and refusing dates outside the unit’s fiscal calendar.
✓ An October date derives the October fiscal context.✗ A date beyond all configured fiscal years fails.
calculationservicetest
04must prove
Proposed
A new batch cannot use a date in a period that is not open, and the refusal identifies that period without duplicating its name.
✓ An Open October period accepts a batch dated within it.✗ A February date fails once that fiscal period is closed.
validationservicetest
05must prove
Proposed
Creation fills an omitted currency with the unit’s base currency and rejects a different currency.
validationservicetest
06must prove
Proposed
A batch name must contain at least one non-space character.
validationapi, database, consoletest
services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses a create without a name 400, naming the field
07must prove
Proposed
An automatically assigned batch reference begins with the business unit’s reference, and an existing reference cannot be assigned to a second batch.
validationservicetest
08must prove
Proposed
Staff creation allows transaction and legacy types, while deferred revenue and cost of goods sold types belong to fiscal close.
policyserviceobserved
09must prove
Proposed
The caller needs batch-create permission to create a batch.
permissionapi, consoletest
services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses a create to a caller without accounting.batches.create 403
10must prove
Proposed
Creation uses the authorized workspace and rejects a body naming another workspace.
validationapitest
services-accounting:modules/batches/tests/e2e/batches.e2e.spec.js#refuses a create naming another tenant in the body 400

Scenarios

IdGivenWhenThenProvenance
01The association’s October period is Open and its base currency is US dollars.Staff submit an October receivables batch dated the twentieth.The response shows an empty Open batch in the October period and base currency.test
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
02The unit already holds a batch named Daily.Staff submit another Daily batch in that unit.Creation refuses the duplicate name without adding a batch.test
services-accounting:modules/batches/tests/e2e/batch-actions.e2e.spec.js#refuses a create whose name another batch of the unit has 409, name_in_use, in 1.0’s sentence
03The association’s February period has closed.Staff request a batch dated in mid-February.The refusal identifies the closed period, while a request dated in a current Open period succeeds.documented

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.