Commit Graph

63 Commits

Author SHA1 Message Date
d4ae5d1d33 Hide system equity accounts from Accounts page
System accounts (Operating Fund Balance, Reserve Fund Balance) are auto-created
as double-entry offsets when users set initial balances. They don't represent
real bank accounts and were confusing to see alongside actual accounts. Now
filtered from account lists, tab counts, and summary card totals. They remain
active under the covers for journal entries and are still visible on the
Balance Sheet report where equity belongs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:44:58 -05:00
f210b05beb Fix cash flow forecast double-counting by using asset accounts consistently
The forecast was counting money twice: operating used asset accounts while
reserve used equity accounts, but both sides of the opening balance journal
entry represent the same funds. Changed all cash balance queries (current,
opening, and historical) to use asset accounts (debit - credit) for both
operating and reserve. Also fixed a LEFT JOIN bug where date filters on
journal_entries didn't prevent journal_entry_lines from being summed,
causing opening balances to include all entries regardless of date.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:34:58 -05:00
b1a28f7a85 Add Phase 4 Cash Flow Visualization with forecast endpoint and Recharts chart
New feature: Cash Flow page under Financials showing stacked area chart of
operating/reserve cash and investment balances over time. Backend forecast
endpoint integrates assessment income schedules, budget expenses, capital
project costs, and investment maturities to project 24+ months forward.
Historical months show actual journal entry balances; future months are
projected. Includes Operating/Reserve/All fund filter, 12-month sliding
window navigation, forecast reference line, and monthly detail table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:03:00 -05:00
8ebd324e77 Remove Investments tab, enhance fund tabs with full investment details and edit
- Removed standalone Investments tab — investment accounts now show only
  under their respective Operating/Reserve tabs with full detail columns
- Investment sub-tables now include: Principal, Current Value, Rate,
  Interest Earned, Maturity Value, Maturity Date, Days Remaining, plus
  summary cards (Total Principal, Total Current Value, Avg Rate)
- Added investment edit capability via modal (name, institution, type,
  fund, principal, current value, rate, purchase/maturity dates, notes)
- Fixed primary account star icon — now shows for all non-system accounts
  (was previously restricted to asset type only), allowing users to set
  default Operating and Reserve accounts regardless of account type
- Fixed Adjust Balance icon to also show for all non-system accounts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:53:04 -05:00
c68a7e21c3 Show investments under Operating/Reserve tabs and include in fund totals
- Investment accounts now appear under their respective Operating/Reserve
  tabs in the Accounts page, with a compact sub-table showing name, type,
  institution, principal/value, rate, interest earned, and maturity info
- Investment values (current_value) are included in dashboard Total Cash KPI
- Reserve investment values are added to Reserve Fund Balance KPI and
  project funded percentage calculations
- Year-end report reserve status now includes reserve investment values
- Tab counts updated to include investment accounts per fund type
- Summary cards show separate "asset (investments)" total for visibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:33:00 -05:00
112578672e Fix reserve fund balance, dynamic project funding, year-end report, and unit form
- Dashboard reserve fund KPI now uses reserve equity accounts (fund balance
  position) instead of asset accounts, correctly showing the total reserve
  fund balance regardless of how users categorize their reserve accounts
- Projects findAll() and findForPlanning() dynamically compute funded_percentage
  and current_fund_balance from reserve equity account balances via CTE,
  distributing the total reserve balance proportionally across projects
- Year-end summary reserve status now queries unified projects table instead
  of deprecated reserve_components table
- Remove standalone Monthly Assessment field from Units form — assessment
  amount is now inherited from the selected assessment group

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:22:31 -05:00
739ccaeed4 Fix account balances showing $0 and dashboard KPIs on new tenants
Root cause: multiple issues with balance computation across the system.

Accounts list:
- findAll() was doing SELECT * FROM accounts, returning the stale
  denormalized `balance` column (always 0). Now computes balances from
  journal entries using proper double-entry logic (debit-credit for
  assets/expenses, credit-debit for liabilities/equity/income).

Dashboard KPIs:
- Total Cash filtered by name LIKE '%Cash%' which missed accounts not
  named "Cash". Now queries ALL asset accounts regardless of name.
- Reserve Fund queried the legacy reserve_components.current_fund_balance
  column. Now computes from journal entries on reserve asset accounts.

Opening balance journal entries:
- On blank tenants, equity offset accounts (3000/3100) don't exist, so
  the balancing journal entry line was silently skipped, leaving entries
  unbalanced. Now auto-creates Operating Fund Balance (3000) and Reserve
  Fund Balance (3100) equity accounts when needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:11:00 -05:00
b0634f7263 Fix initial balance journal entries and add investment account creation
- Fix account creation initial balance bug: the INSERT RETURNING result
  was not being unwrapped correctly from TypeORM's array response, causing
  account.id to be undefined and journal entry lines to have $0 amounts.
  Now uses findOne() after insert for reliable ID retrieval.
- Add missing balancing equity entry line (debit/credit to account 3000/3100)
  so opening balance journal entries are proper double-entry
- Fix account update to use findOne() instead of RETURNING * for consistent
  response format
- Add investment account creation to Accounts page: account type dropdown now
  shows a separator followed by investment types (CD, Money Market, Treasury,
  Savings, Brokerage). Selecting an investment type expands the modal to show
  investment-specific fields (institution, principal, interest rate, purchase
  date, maturity date, account last 4, notes) and posts to /investment-accounts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:13:22 -05:00
301f8a7bde Phase 3: Optimize & clean up — unified projects, account enhancements, new tenant fix
- Unify reserve_components + capital_projects into single projects model with
  full CRUD backend and new Projects page frontend
- Rewrite Capital Planning to read from unified projects/planning endpoint;
  add empty state directing users to Projects page when no planning items exist
- Add default designation to assessment groups with auto-set on first creation;
  units now require an assessment group (pre-populated with default)
- Add primary account designation (one per fund type) and balance adjustment
  via journal entries against equity offset accounts (3000/3100)
- Add computed investment fields (interest earned, maturity value, days remaining)
  with PostgreSQL date arithmetic fix for DATE - DATE integer result
- Restructure sidebar: investments in Accounts tab, Year-End under Reports,
  Planning section with Projects and Capital Planning
- Fix new tenant creation seeding unwanted default chart of accounts —
  new tenants now start with a blank slate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 14:32:35 -05:00
17fdacc0f2 Phase 2 tweaks: admin tenant creation, unit delete, frequency, UI overhaul
- Admin panel: create tenants with org + first user, manage org status
  (active/suspended/archived), contract number and plan level fields
- Units: delete with invoice check, assessment group dropdown binding
- Assessment groups: frequency field (monthly/quarterly/annual) with
  income calculations normalized to monthly equivalents
- Sidebar: grouped nav sections (Financials, Assessments, Transactions,
  Planning, Reports, Admin), renamed Chart of Accounts to Accounts
- Header: replaced text with SVG logo
- Capital projects: Kanban as default view, table-only PDF export,
  Future category (beyond 5-year plan)
- Auth: block login for suspended/archived organizations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:00:16 -05:00
01502e07bc Implement Phase 2 features: roles, assessment groups, budget import, Kanban
- Add hierarchical roles: SuperUser Admin (is_superadmin flag), Tenant Admin,
  Tenant User with separate /admin route and admin panel
- Add Assessment Groups module for property type-based assessment rates
  (SFHs, Condos, Estate Lots with different regular/special rates)
- Enhance Chart of Accounts: initial balance on create (with journal entry),
  archive/restore accounts, edit all fields including account number & fund type
- Add Budget CSV import with downloadable template and account mapping
- Add Capital Projects Kanban board with drag-and-drop between year columns,
  table/kanban view toggle, and PDF export via browser print
- Update seed data with assessment groups, second test user, superadmin flag
- Create repeatable reseed.sh script for clean database population
- Fix AgingReportPage Mantine v7 Table prop compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:28:46 -05:00
e0272f9d8a Rename to HOA LedgerIQ and implement remaining report pages
- Rename app from "HOA Financial Platform" to "HOA LedgerIQ" across all
  frontend pages, backend API docs, package.json files, and seed data
- Add Cash Flow Statement report (GET /reports/cash-flow) with operating
  and reserve fund activity breakdown, beginning/ending cash balances
- Add Aging Report (GET /reports/aging) with per-unit aging buckets
  (current, 1-30, 31-60, 61-90, 90+ days), expandable invoice details
- Add Year-End Package (GET /reports/year-end) with income statement
  summary, collection stats, 1099-NEC vendor report, reserve fund status
- Add Settings page showing org info, user profile, and system details
- Replace all PlaceholderPage references with real implementations
- Bump auth store version to 3 for localStorage migration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 09:09:50 -05:00
243770cea5 Initial commit: HOA Financial Intelligence Platform MVP
Multi-tenant financial management platform for homeowner associations featuring:
- NestJS backend with 16 modules (auth, accounts, transactions, budgets, units,
  invoices, payments, vendors, reserves, investments, capital projects, reports)
- React + Mantine frontend with dashboard, CRUD pages, and financial reports
- Schema-per-tenant PostgreSQL isolation with JWT-based tenant resolution
- Docker Compose infrastructure (nginx, backend, frontend, postgres, redis)
- Comprehensive seed data for Sunrise Valley HOA demo
- 39 API endpoints with Swagger documentation
- Double-entry bookkeeping with journal entries
- Budget vs actual reporting and Sankey cash flow visualization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 19:58:04 -05:00