Sub-Domain Blueprint: Finance Ledger
Domain: Finance (Ledger, Budget, AP, AR)
Logical Sub-Domain: Ledger (Core Accounting)
Physical Packages: @sd/mod-finance/ledger, @sd/mod-finance/budget
Related Documents: Data Definition
Context: This document defines the General Ledger (GL) and Budgeting foundation.
Status: Stable (v2.5)
1. Mandate
The Ledger Sub-Domain is the SINGLE SOURCE OF FINANCIAL TRUTH. It adheres to GAAP standards, enforcing Double-Entry Bookkeeping, Immutability (Append-Only), and Atomicity (Balance Updates match Journal Entries). It is consistent with Standard Accounting Principles.
2. Capabilities
| Capability | Description | Component |
|---|---|---|
| Journal Posting | Creating balanced (Dr = Cr) transactions. | postEntry |
| Chart of Accounts | Defining the financial structure (Asset, Liability, etc). |
Account |
| Budget Planning | Annual forecasting of Revenues and Expenses. | Budget |
| Immutability | Preventing deletion of posted entries (Reversal Only). | voidEntry |
3. Process Models
A. Posting a Journal Entry
Happy Path: Monthly Dues Revenue Recognition.
sequenceDiagram
participant System
participant Service as LedgerService
participant DB as Firestore
System->>Service: postEntry(desc="Jan Dues")
Service->>Service: Validate Sum(Dr) == Sum(Cr)
rect rgb(200, 255, 200)
Note right of Service: ATOMIC WRITE
Service->>DB: Create JournalEntry
Service->>DB: Update Account Balances
end
Service->>Signal: emit("METRIC_ALERT")
B. Budget Approval Cycle
Happy Path: Annual Meeting Vote.
sequenceDiagram
participant Admin
participant Service as BudgetService
participant Board as Governance
Admin->>Service: createBudget(year=2026, status="draft")
Service->>Board: submitForVote(budgetId)
Board-->>Service: Approved (Motion #101)
Service->>Service: setStatus("approved")
4. State Machines
Journal Entry Status
stateDiagram-v2
[*] --> Posted: Validated
Posted --> Void: Reversed (Offset Entry Created)
5. Interface Definitions
LedgerService
postEntry(entry): Promise<JournalEntry>createAccount(acct): Promise<Account>getTrialBalance(): Promise<number>voidEntry(id, reason): Promise<Entry>
6. Changelog
| Date | Author | Description | Reference |
|---|---|---|---|
| 2026-01-24 | Antigravity | Initial creation | Implementation Plan |