forked from aiolabs/libra
Full identifier rename: module path lnbits.extensions.castle →
lnbits.extensions.libra, DB ext_castle → ext_libra, URL prefix
/castle/ → /libra/, manifest id castle → libra, fava ledger slug
default castle-ledger → libra-ledger, Beancount source metadata
castle-api → libra-api and link prefixes castle-{entry,tx}- →
libra-{entry,tx}-, column castle_wallet_id → libra_wallet_id, all
Python/JS/HTML identifiers (castle_ext, CastleSettings,
castle_reference, castleWalletConfigured, etc.).
Display name "Castle Accounting" → "Libra" (the scales/balance
metaphor — fits double-entry bookkeeping).
No backward compat: production hosts will be force-updated. Old
castle-prefixed Beancount metadata in existing Fava ledgers is
historical; new entries use libra-* prefixes going forward.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 lines
738 B
Python
25 lines
738 B
Python
"""
|
|
Libra Core Module - Pure accounting logic separated from database operations.
|
|
|
|
This module contains the core business logic for double-entry accounting,
|
|
following Beancount patterns for clean architecture:
|
|
|
|
- validation.py: Comprehensive validation rules
|
|
|
|
Benefits:
|
|
- Testable without database
|
|
- Reusable across different storage backends
|
|
- Clear separation of concerns
|
|
- Easier to audit and verify
|
|
|
|
Note: Balance calculation and inventory tracking have been migrated to Fava/Beancount.
|
|
All accounting calculations are now performed via Fava's query API.
|
|
"""
|
|
|
|
from .validation import ValidationError, validate_journal_entry, validate_balance
|
|
|
|
__all__ = [
|
|
"ValidationError",
|
|
"validate_journal_entry",
|
|
"validate_balance",
|
|
]
|