Skip to content

feat(health): improve health center issue details for negative balance and FX integrity#830

Merged
afadil merged 9 commits intoafadil:mainfrom
Jonjon-prog:fix/health-negative-balance-affected-items
Apr 13, 2026
Merged

feat(health): improve health center issue details for negative balance and FX integrity#830
afadil merged 9 commits intoafadil:mainfrom
Jonjon-prog:fix/health-negative-balance-affected-items

Conversation

@Jonjon-prog
Copy link
Copy Markdown
Contributor

@Jonjon-prog Jonjon-prog commented Apr 8, 2026

Hello @afadil,

I hope you are doing great.
I did some changes for the health center, to help the user got more informations to solve the issues.
Specially regarding negative balance and Fx integrity.

Summary

Improves the Health Center issue drawer with more actionable details for two issue types.

Negative Balance (Data Consistency)

  • Before: only showed the account name and affected count
  • After: shows per-account details — first negative date, cash balance, investment value, and a likely cause (missing transfer, missing buy transaction, etc.)
  • CASH accounts that go negative now show an INFO warning instead of ERROR, since it's common and expected behavior (e.g. fees debited before cash is deposited)

FX Integrity

  • Before: only showed a count of affected currency pairs
  • After: lists each affected pair (e.g. EUR → USD) in the drawer so the user knows exactly which conversions are broken

Other

  • Fix unused import warning for NegativeBalanceInfo in crates/ai/src/env.rs

Key files changed

  • crates/core/src/health/checks/data_consistency.rs — negative balance logic and details
  • crates/core/src/health/checks/fx_integrity.rs — FX affected items
  • crates/core/src/portfolio/valuation/NegativeBalanceInfo model and query

Test plan

  • Account with negative balance shows date, cash/investment breakdown and likely cause in detail drawer
  • CASH account with negative balance shows INFO (not ERROR)
  • FX integrity issue lists affected currency pairs in detail drawer

Checklist

By submitting this PR, I agree to the CLA.

@afadil afadil merged commit e328be1 into afadil:main Apr 13, 2026
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.

2 participants