Money that has been recorded stays recorded

Append-only money

Money that has been recorded stays recorded.

app ledgers "Ledgers" {}

entity Payment ledger {
  amount: money USD
  method: text
}

entity Invoice {
  total: money USD

  workflow {
    initial Open
    states Open, Paid
    terminal Paid

    pay: Open -> Paid {
      do append Payment { amount: total, method: "card" }
    }
  }
}

An update or a delete of a ledger row is query/ledger-mutation, and the write that stays is an append.