[BUG-94] LeanFin: show the full balance total on short time windows - #117
Merged
Conversation
Manual accounts only get a balance snapshot when their value is updated (or a CSV is imported). The balance series for a manual account was built solely from snapshots inside the selected window, so an account untouched for longer than the window produced an empty series and silently dropped out of the aggregated total. Seed the manual window with the most recent snapshot before the cutoff so the last known balance is carried forward, and exclude archived accounts from the aggregated series to match the account selector on the same page (without which closed accounts would now carry their balance forward forever). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Resolved conflicts in the non-bank balance series branch (main widened the manual-account path to every non-bank account type for Indexa Capital) and in the manual accounts requirements bullet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
fill_balance_gapscarries the last known balance forward across the whole period.docs/requirements.md.Test plan
make check(fmt + clippy + full test suite) passes.crates/myapps-leanfin/tests/leanfin/balance_evolution.rs:manual_account_without_recent_entries_still_shows_balance— an account last updated 200 days ago still renders its balance over a 90d window.aggregated_series_includes_manual_account_without_recent_entries— total is 6000, not 1000.aggregated_series_excludes_archived_accounts— an archived account does not inflate the total.Note: an account whose first ever snapshot falls inside the window (e.g. a bank connected 20 days ago viewed over 90d) still steps up on that date. That is genuinely unknown history rather than a missing carry-forward, so it is left as is.
🤖 Generated with Claude Code