Support temporary balance adjustments for linked accounts
Problem
Linked accounts currently treat the provider-reported current balance as authoritative on every sync. When an institution applies a balance-only adjustment that has not propagated through the aggregation provider, Sure cannot represent the institution balance without either:
- repeatedly overwriting the current balance after every sync, or
- creating a synthetic transaction that never appeared in the provider feed.
Transaction exclusion does not solve this because it correctly affects budgets and reports, not the provider-supplied account balance.
A common example is a disputed credit-card charge: the issuer removes the disputed amount from the amount owed while the aggregator continues reporting a balance that includes it. The original charge should remain visible for audit history, and no reimbursement should be invented.
Proposed behavior
Add an explicit, account-scoped provider balance adjustment for linked accounts:
- preserve the raw provider balance for diagnostics;
- apply a user-entered signed adjustment when calculating the effective current balance;
- record a reason and effective date;
- show that the displayed balance is adjusted;
- allow the adjustment to be cleared without changing imported transactions;
- warn when a provider balance change suggests the upstream source has caught up, to avoid double-adjustment.
The adjustment should not be inferred from ordinary excluded transactions.
Acceptance criteria
- A linked account sync reapplies an active balance adjustment after importing the provider balance.
- Imported transactions and the raw provider balance remain unchanged.
- Clearing the adjustment restores the provider balance on the next calculation/sync.
- Family/account authorization boundaries are preserved.
- Model and controller tests cover applying, persisting across sync, and clearing an adjustment.
Source: we-promise/sure