Skip to content

Double entry accounting milestone 8 - #89

Merged
chongfun merged 2 commits into
double_entry_accounting_milestone_7from
double_entry_accounting_milestone_8
Aug 24, 2026
Merged

Double entry accounting milestone 8#89
chongfun merged 2 commits into
double_entry_accounting_milestone_7from
double_entry_accounting_milestone_8

Conversation

@chongfun

Copy link
Copy Markdown
Owner

Replace operational reporting like this:

Property
  -> Charges
  -> Receipts
  -> Expenses
  -> SecurityDepositTransactions
  -> combine/sort/recalculate

with:

Property / Tenancy / Account
        ↓
Posting
        ↓
JournalEntry
        ↓
source record only for semantic explanation

The ledger answers:

How much?
When?
Which account?
Which property/unit/tenancy/party?
What changed after reversal?

The domain source still answers:

Why?
What kind of charge?
Who paid?
Which expense?
Which deposit application?

That is the PRD's intended boundary: domain records explain why, ledger records explain the financial effect.

…views

- Add database composite reporting indexes on postings and journal_entries for performant multidimensional queries
- Replace legacy domain queries with immutable double-entry ledger queries (deprecating Properties::FinancialItemsQuery and Properties::ActiveYearsQuery)
- Implement core accounting reporting primitives:
  * Accounting::DateRange with range_mode parameter handling, single-year resolution, and bounded from-only queries
  * Accounting::NaturalBalance for normal-balance conversions across asset, liability, equity, income, and expense accounts
  * Accounting::AccountBalanceQuery for multidimensional point-in-time balance calculations
  * Accounting::ActiveYearsQuery deriving active reporting years from journal entries
- Implement operational reporting queries and projectors:
  * Accounting::ActivityRow and Accounting::ActivityProjector for projecting journal entries into domain-rich activity rows with as-of lifecycle awareness (distinguishing charge waivers from bookkeeping corrections)
  * Accounting::PropertySummaryQuery for property financial summaries with exact Net Cash Movement and signed income/expense recognition
  * Accounting::PropertyLedgerQuery for property-level chronological ledger activity
  * Accounting::TenantReceivableActivityQuery for tenant receivable subledger statements with running balances
  * Accounting::TenancyActivityQuery for full tenancy financial activity including security deposit custody events
  * Accounting::RecentTenantReceivableActivityQuery for bounded O(1) memory recent activity rendering
  * Accounting::AccountActivityQuery with eager loading to prevent N+1 queries across row associations
- Build and update reporting views and controllers:
  * Chart of Accounts index and show pages (AccountsController, views/accounts) with point-in-time balances and dimension filtering
  * Journal Entry audit page (JournalEntriesController, views/journal_entries/show) with two-way reversal navigation
  * Property financial dashboard partial (views/properties/_financials) with Net Cash Movement, valid date range guards, and Schedule E links
  * Tenancy statement page (views/tenancies/statement) with tabbed switching between Tenant Receivable Statement and All Financial Activity
  * Recent activity cards on Tenancy and Property show pages
@chongfun chongfun self-assigned this Aug 22, 2026
@chongfun
chongfun merged commit 0c9bdec into main Aug 24, 2026
5 checks passed
@chongfun
chongfun deleted the double_entry_accounting_milestone_8 branch August 24, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant