---
id: "money-store-without-double-entry-ledger"
type: "rule"
severity: "error"
url: "https://localhost:3000/catalogue/rules/money-store-without-double-entry-ledger"
---

# Money store without double-entry ledger

The design requires zero-sum money movement but contains no ledger node.

| | |
|---|---|
| Severity | error |
| Selects | every design |
| Components in scope | 2,366 |

## Why

The design promises that money movements sum to zero, but it has no ledger to enforce double entry. Balances kept in an ordinary table drift and cannot be audited.

## What it checks

It looks at every design, and fires when:

- all of these hold:
  - the design requirement `money.zeroSum` is true
  - this does not hold:
    - the design contains a node of kind ledger

Message template:

```
Design '{{design.id}}' requires zero-sum money movement but has no ledger node. Record money in an append-only double-entry ledger.
```

## Applies to

This rule is about the whole design, not one node.

2,366 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [digital-wallet](https://localhost:3000/d/zeema/digital-wallet)
- [payment-system](https://localhost:3000/d/zeema/payment-system)
- [stock-exchange](https://localhost:3000/d/zeema/stock-exchange)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# The design promises the books balance to zero, but no ledger kind exists to enforce
# double entry. Balances kept in an ordinary table drift and cannot be audited.
# Tripped by: designs/payment-system.broken.yaml
schemaVersion: "1"
type: "rule"
id: "money-store-without-double-entry-ledger"
severity: "error"
select:
  design: true
when:
  all:
    - requirement: "money.zeroSum"
      equals: true
    - not:
        hasNode:
          kind: "ledger"
message: "Design '{{design.id}}' requires zero-sum money movement but has no ledger node. Record money in an append-only double-entry ledger."
```

Human page: https://localhost:3000/catalogue/rules/money-store-without-double-entry-ledger
