The book the store's money is written into.
An entry is a set of legs whose signed minor units sum to zero; a debit is positive and a credit is negative. The builders are pure and the in-memory implementation is the default, so the double-entry law holds with no backend present. A real book lives in an adapter behind its own alias.
The book the store's money is written into. An entry is a set of legs whose signed minor units sum to zero; a debit is positive and a credit is negative. The builders are pure and the in-memory implementation is the default, so the double-entry law holds with no backend present. A real book lives in an adapter behind its own alias.
The accounts one store's money moves between.
The accounts one store's money moves between.
(balanced? legs)True when legs sum to zero minor units.
True when `legs` sum to zero minor units.
What the book needs to know about an invoice, and nothing more.
Deliberately not schema/Invoice: a host store's invoice carries its own
keys — a plan rather than an item, periods, entitlements — and the builders
read none of them. Demanding the whole record would make the book unusable
by the very stores it exists for.
What the book needs to know about an invoice, and nothing more. Deliberately not `schema/Invoice`: a host store's invoice carries its own keys — a plan rather than an item, periods, entitlements — and the builders read none of them. Demanding the whole record would make the book unusable by the very stores it exists for.
(balance this account currency-id)Signed minor units of currency-id standing in account.
Signed minor units of `currency-id` standing in `account`.
(post! this entry)Record entry. Returns it, or nil when its reference was already recorded.
Record `entry`. Returns it, or nil when its reference was already recorded.
(posted? this reference)True when reference has already been recorded.
True when `reference` has already been recorded.
However the host store names an invoice.
Deliberately not :uuid. This store mints uuids; another mints a string its
gateway will echo back as a description. The book records the id it is given
and never parses it.
However the host store names an invoice. Deliberately not `:uuid`. This store mints uuids; another mints a string its gateway will echo back as a description. The book records the id it is given and never parses it.
One balanced movement, identified by the reference that makes it repeatable.
One balanced movement, identified by the reference that makes it repeatable.
One side of an entry. :leg/amount is signed minor units: debit positive,
credit negative.
One side of an entry. `:leg/amount` is signed minor units: debit positive, credit negative.
(memory-ledger)ILedger over an atom. The default, and what the tests run on.
post! is a swap! that keeps the first entry for a reference, so a
redelivered settlement adds nothing.
ILedger over an atom. The default, and what the tests run on. `post!` is a `swap!` that keeps the first entry for a reference, so a redelivered settlement adds nothing.
What the book needs to know about one observed movement of money.
:payment/reference is the idempotency key: derived from the movements the
rail named, so re-seeing the same money yields the same reference and books
once.
What the book needs to know about one observed movement of money. `:payment/reference` is the idempotency key: derived from the movements the rail named, so re-seeing the same money yields the same reference and books once.
(sale-entry invoice at)The entry booking invoice as revenue owed: debit receivable, credit revenue.
at is the entry's timestamp. Pure.
The entry booking `invoice` as revenue owed: debit receivable, credit revenue. `at` is the entry's timestamp. Pure.
(settlement-entry invoice payment)The entry booking payment against invoice: debit wallet, credit receivable.
The reference is the payment's own, so the same observed movement books once however often it is seen. Pure.
The entry booking `payment` against `invoice`: debit wallet, credit receivable. The reference is the payment's own, so the same observed movement books once however often it is seen. Pure.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |