feat(transactions): exclude investment-account activity from spending/income - #157
Merged
KenTaniguchi-R merged 1 commit intoSep 5, 2026
Merged
Conversation
…/income Alpaca (and other Plaid-linked brokerage) fills and clearing fees were landing in the Transactions tab miscategorized as "Investment Income" and inflating spending/income totals across Transactions, Reports, Budgets, and the Dashboard. Reuses the existing isTransfer/transferSource mechanism from the transfer-detection feature (#156): any transaction on an account.type === "investment" account is deterministically tagged transferSource="investment_account" at sync time, which every spend/income aggregator already excludes via isTransfer=false. Rows still appear in the Transactions list, labeled "Investment" instead of the wrong category. A backfill job retags already-synced history (pnpm backfill-investment-activity) and, like the transfer tiers, never overwrites a manual/manual_rejected user correction.
KenTaniguchi-R
deleted the
feat/exclude-investment-activity-from-spending
branch
September 5, 2026 08:53
KenTaniguchi-R
added a commit
that referenced
this pull request
Sep 6, 2026
Ship #157 (exclude investment-account activity from spending/income) and #159 (dashboard number clipping), which have sat on main since v0.3.0 without a published image — :latest only moves on a v* tag. Also bumps package.json, which v0.3.0 forgot: /api/health reads its version from here via APP_VERSION, so the deployed app has been reporting 0.2.0 while running 0.3.0 code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isTransfer/transferSourcemechanism from Flag transfers that only touch one Ledgr account #156: any transaction on anaccount.type === "investment"account is deterministically taggedtransferSource="investment_account"at sync time — no ambiguity, no review queue needed. Every spend/income aggregator already excludesisTransfer=truerows, so totals correct themselves with no query changes.pnpm backfill-investment-activityretags already-synced history; respects manual/manual_rejected user corrections, same as the transfer tiers.Test plan
pnpm typecheck/pnpm lintcleancategory-pill-label.test.ts(Investment label branch)transaction-sync.test.ts(tags investment fills, leaves other accounts alone, never overwritesmanual_rejected),backfill-investment-activity.test.ts(tags historical rows, idempotent, skips manual_rejected)test:changedrun green aside from a pre-existing unrelated flake (investment-queries.test.tsdate rot)pnpm backfill-investment-activityagainst a real dev DB to confirm existing Alpaca history relabels correctly🤖 Generated with Claude Code