Welcome! This is the extension for building a double entry accounting system in Ash. This extension provides the basic building blocks for you to extend as necessary.
Double entry is a fundamental accounting principle that ensures every financial transaction is recorded in at least two accounts. Each transaction records a debit (money going out) and credit (money coming in), where total debits must equal total credits. This dual-record system allows you to detect errors and ensures that books always balance.
AshDoubleEntry implements double entry accounting through three core resources:
- AshDoubleEntry.Account DSL, which represents accounts in your ledger (such as bank accounts, revenue accounts, expense accounts, etc.)
- AshDoubleEntry.Transfer DSL, which represents transactions between accounts, always linking a
from_accountandto_accountwith an amount - AshDoubleEntry.Balance DSL, which tracks the balance of each account at the point of each transfer for recordkeeping
When you create a balance transfer, the system creates entries for both the credit and debit accounts and updates all future balances to reflect the transaction.
As double entry accounting is a specialized financial feature that is only necessary for certain Ash applications, keeping it as a separate repository allows the main framework to remain focused on core functionality. This also allows the implementation of double entry to evolve separately from the core Ash framework. Ash applications that don't need double entry accounting can safely ignore this.
This follows the same pattern as other Ash extensions like AshMoney and AshAuthentication, which are also maintained as separate packages.

