Skip to content

Migrate journal entries to double-entry mutations model#156

Open
eirvandelden wants to merge 15 commits into
mainfrom
claude/double-entry-bookkeeping
Open

Migrate journal entries to double-entry mutations model#156
eirvandelden wants to merge 15 commits into
mainfrom
claude/double-entry-bookkeeping

Conversation

@eirvandelden

Copy link
Copy Markdown
Owner

This PR migrates transaction storage from STI debit/credit/transfer rows to a double-entry bookkeeping model with mutation rows, including schema and data migrations. It updates import, categorization, dashboard aggregation, and transaction CRUD paths to use mutation-based amounts and ownership logic. It adds regression tests for duplicate import handling, invalid row parsing, mutation integrity rules, concrete dashboard totals, and the new Mutation model while removing legacy accountable/STI tests and classes. It also hardens rollout behavior by running with-data DB preparation and preserving a legacy transactions backup table during migration.

@eirvandelden eirvandelden force-pushed the claude/double-entry-bookkeeping branch 2 times, most recently from 33c1578 to a3f05c3 Compare March 5, 2026 15:44
eirvandelden and others added 12 commits March 13, 2026 15:03
Add named scopes (own/external) to Account model and update the index view to display two separate paginated tables: one for family accounts (with owner set) and one for external accounts (owner nil). External table omits the owner column since it's always nil.

Changes:
- Add :own and :external scopes to Account model
- Split controller queries with independent pagination (own_page/external_page params)
- Update view with two sections and h2 headings for each account type
- Add i18n keys: own_accounts/external_accounts in all locales (en/nl/it)
- Add scope tests to account_test.rb

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r? predicate

After rebasing onto main (which had STI-based transfer linking), the double-entry
branch was missing the type column. Replace all type == "Transfer" checks with a
transfer? predicate based on category name, fix invalid fixture columns, and update
fixture references renamed during the double-entry semantic alignment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eirvandelden eirvandelden force-pushed the claude/double-entry-bookkeeping branch from 2e23b93 to 697cb23 Compare March 13, 2026 14:20
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