Skip to content

CAP-ACC-REC-011Finalize a balanced explanation with eligible approval

Markdown

CAP-ACC-REC-011

Finalize a balanced explanation with eligible approval

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaAccountingModuleReconciliationRevision2

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
Exact recomputed balance is required for finalization.Independent approval is required by default and waived decisions stay marked.Generated accounting distinguishes the transfer from individual recognition effects.
Surfaces
consoleapi
Intent sources
services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D3services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D7services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D2services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D10 (§4: the architecture §6 invariants hold; INV-07, INV-08, INV-12, INV-15, INV-16)

Controls

28 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-005 TC-AI-005 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
accounting.reconciliation-batches.finalizeapitenant
accounting.reconciliation-batches.finalizeconsoletenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Finalize checks the request key and read version, replays a successful identical call without another ledger request and rejects a fresh-key attempt on the finalized record.
origin: services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D10 (§2: idempotency of every money command)
validationapi, servicetest
02must prove
Confirmed
Finalize recomputes the difference from actual claims and payout links, rejects any nonzero amount with an audited refusal and leaves the reconciliation open.
✓ A reconciliation one cent short is refused with a difference of -1.✗ Counters that read zero over rows that do not are refused.
origin: services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D10 (§4: the architecture §6 invariants hold; INV-07)
calculationservice, databasetest
03must prove
Confirmed
The default second-person policy excludes the creator and anyone who claimed, released, added manual items or linked payouts, recording a refused self-approval.
policyservicetest
services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/finalize-batch.integration.spec.js#refuses a person who claimed items in it; services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/finalize-batch.integration.spec.js#refuses the person who created the batch; services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/finalize-batch.integration.spec.js#records the refusal as batch.finalize-refused; services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/finalize-batch.integration.spec.js#lets the preparer finalize where the tenant does not require a second person, waived; services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/finalize-batch.integration.spec.js#records segregation.waived for that finalize; services-accounting:modules/reconciliation/tests/unit/rules/segregation.spec.js#refuses a preparer while a second person is required; services-accounting:modules/reconciliation/tests/unit/rules/segregation.spec.js#records any finalize as waived when the tenant does not require a second person; services-accounting:modules/reconciliation/tests/e2e/batch-lifecycle.e2e.spec.js#refuses the preparer with 403 segregation-required; react-console:acceptance/accounting/playwright/journeys/reconciliation-close/ACT-ACC-0590.spec.ts#ACT-ACC-0590; react-console:acceptance/accounting/playwright/journeys/reconciliation-close/ACT-ACC-0597.spec.ts#ACT-ACC-0597
04must prove
Confirmed
With the second-person requirement disabled, preparers can finalize and every finalization records that the control was waived.
policyservicetest
05must prove
Confirmed
Finalization rejects a voided reconciliation, absent payout links, voided linked payouts and resolved claimed items.
validationservicetest
06must prove
Confirmed
Finalize creates a single transfer request containing nonzero net lines per bank and a clearing total when nonzero, plus required unrecognized manual or imported fee, reserve and adjustment requests; an all-zero transfer is omitted.
✓ A 9,725.00 deposit with a 225.00 fee and 50.00 reserve asks for three balanced entries.✗ A zero payout asks for its fee only.
calculationserviceobserved
07must prove
Confirmed
Missing default accounts stop finalization before writes and identify the account purpose requiring setup.
origin: services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D7 (refused by name when a default is missing)
validationservicetest
08must prove
Confirmed
After operational batch posting, reconciliation entries offset the posted captures and refunds it explains in processor clearing.
invariantserviceobserved
09must prove
Confirmed
Finalized holdings, notes, totals and payout amounts remain sealed; reversal is the supported way to release them.
origin: services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D10 (§4: the architecture §6 invariants hold; INV-08)
lifecycleservice, databasetest
10must prove
Confirmed
Finalize closes open unbalanced-payout exceptions and records the finalizer, operational batch, dates and ledger keys.
origin: services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D6 (architecture §3.4 U10: finalize resolves only exceptions whose condition it cleared)
lifecycleservicetest
11must prove
Confirmed
Period locking serializes finalize with close, marks closed-period effects late and uses the default-selected operational batch’s date only when that batch accepts work in an open period, without automatically selecting a later batch.
origin: services-accounting:docs/milestones/plans/ACCT-M8-plan.md#D10 (§4: the architecture §6 invariants hold; INV-16)
policyservice, databaseobserved
12must prove
Confirmed
The sensitive finalize permission and preparation guards determine whether finalize is offered, including an explanation when preparation prevents it.
permissionapi, servicetest
13
Confirmed
Console finalize is hidden from a disqualified preparer, saves current draft changes first and labels a waived result as finalized without second approval.
policyconsoleobserved

Scenarios

IdGivenWhenThenProvenance
01The sample explanation balances with fee and reserve entries prepared by one person.Have that preparer attempt approval, then an independent approver finalize.Preparation prevents self-approval and the independent decision creates the required transfer and recognitions.test
services-accounting:modules/reconciliation/tests/e2e/reconciliation-scenario.e2e.spec.js#step 7: posts the fee 22500, the reserve 5000 and the bank 972500 against the clearing account, each balanced
02The explanation differs by one minor unit.Attempt finalize.The difference is reported and the draft stays open.test

Edge Cases

IdGivenWhenThenProvenance
03A fee-only deposit is negative.Finalize its explanation.Accounting requests the transfer from bank back to clearing.test
04No operational batch accepts the generated requests.Attempt finalize.Rollback leaves the open version intact without a request or event.test
services-accounting:modules/reconciliation/tests/integration/services/batch-lifecycle/finalize-batch.integration.spec.js#writes nothing when refused for want of a batch: the batch open at its version, no request, no event

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.