Initial commit: wanderbooks accounting semantics engine

This commit is contained in:
swaits committed 2026-10-11 00:46:11 +00:00
1 parent 3489554f57
commit d3a0b097b2
1 file changed
+31
+31
View File
@@ -0,0 +1,31 @@
//! `ledger-core`: canonical double-entry bookkeeping semantics.
//!
//! This crate is the engine. Everything else in the workspace — persistence,
//! import, the oracle harness, the UI — builds on top of it and never
//! reimplements accounting logic.
//!
//! Design rules (see `AGENTS.md` at the repo root):
//!
//! * Money is [`Money`]: an exact [`rust_decimal::Decimal`] plus an ISO 4217
//! currency code. Binary floats never touch money paths.
//! * A [`Ledger`] is single-currency for now (see `docs/requirements.md` R-5).
//! * All mutations go through [`Ledger`] commands (`create_entry`, `add_line`,
//! `post_entry`, `reverse_entry`). Posted entries are immutable; corrections
//! are reversing entries.
//! * Reports ([`trial_balance`], [`balance_sheet`], [`profit_and_loss`]) are
//! pure functions of a ledger, which is what makes the semantic oracle
//! (`docs/oracle.md`) possible.
pub mod account;
pub mod error;
pub mod journal;
pub mod ledger;
pub mod money;
pub mod reports;
pub use account::{Account, AccountId, AccountType, ChartOfAccounts, Side};
pub use error::LedgerError;
pub use journal::{EntryId, EntryStatus, JournalEntry, JournalLine};
pub use ledger::Ledger;
pub use money::{Currency, Money};
pub use reports::{BalanceSheet, ProfitAndLoss, TrialBalance, TrialBalanceLine};