---
id: ADR-ACC-BAT-010
title: Enforce immutable balanced ledger rows in minor units
product_area: accounting
module: batches
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  Ledger headers and lines are immutable after insertion, balanced by
  commit-time database checks and stored as non-negative minor-unit movements;
  same-unit references constrain account ownership.
constrains:
  - DOM-ACC-BAT-004
  - DOM-ACC-BAT-005
  - SVC-ACC-BAT-batches
  - WF-ACC-BAT-011
origin: >-
  D-04 (Andrew, 2026-10-17: bigint minor units everywhere) and Andrew D9
  (2026-10-15: the ledger is append-only), recorded at
  services-accounting:docs/architecture/accounting-2.0/02-decisions.md §1 and
  modules/batches/export/subledger.dataset.ts; DESIGN D3
alternatives:
  - option: Check balance only in application code.
    why_not: Other writers or bypass switches could evade application-only validation.
  - option: Retain decimal money as the storage representation.
    why_not: The recorded Accounting choice adopts integer minor units consistently.
consequences:
  - >-
    Application roles lack direct ledger modification rights; guarded functions
    provide ordinary removal and deletion-lifecycle purge.
  - >-
    Exceptional ledger migrations require explicitly controlled trigger
    handling.
  - Reporting projections convert stored amounts for major-unit presentation.
supersedes: []
evidence:
  - >-
    services-accounting at f47cb263:
    modules/batches/db/subledger-entries.table.ts,
    subledger-entry-lines.table.ts;
    docs/architecture/accounting-2.0/08-batch-posting.md §8
---

# Enforce immutable balanced ledger rows in minor units

## Context

The recorded money and ledger rulings establish the representation and protection boundary. Later ordinary deletion policy qualifies append-only storage with guarded removal.

## Decision

The decision field restates the existing recorded direction for this design boundary. This examination does not grant a new approval.

## Alternatives Considered

The alternatives above identify the competing implementation choices and their consequences. They preserve the distinction between a recorded product ruling and a proposed engineering boundary.

## Consequences

The consequence rows describe obligations and known implementation limits at this boundary. Related artifact references retain the affected design homes.
