broker-sync/broker_sync/providers
Viktor Barzin 98c4729622
Some checks failed
ci/woodpecker/push/build Pipeline failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
CI / deploy (push) Has been cancelled
fidelity: replace snapshot-push with delta gains-offset DEPOSITs
Per-fund snapshot import landed quantities but dropped cost basis +
needed a separate quote-push path we never identified. Snapshotting
also collided with WF's own TOTAL aggregation and ZEROED the Fidelity
cash balance.

Simpler plan: each monthly scrape emits a single DEPOSIT (or
WITHDRAWAL on a market drop) sized to the delta between the live
PlanViewer pot value and Wealthfolio's running total. dav_corrected
PG view continues to subtract these offsets from net_contribution so
the dashboard Growth/ROI math stays right.

- New gains_offset_delta_activity() — current_gain - prior_offset.
- New WealthfolioSink.cumulative_amount_with_notes_prefix() — sums
  the existing fidelity-planviewer:unrealised-gains-offset DEPOSITs
  in WF so we know what's already been emitted.
- CLI runs sync_provider_to_wealthfolio first (cash flows), then
  computes + emits the delta via import_activities.
- 4 new provider tests for the delta logic; full suite (144 + 1
  skipped) green; mypy + ruff clean.

The old fidelity_holdings_to_snapshot helper + push_manual_snapshots
sink method stay for future use but are no longer called.
2026-05-17 00:35:17 +00:00
..
parsers schwab: detect vest-confirmation emails + emit VestEvent 2026-04-19 18:27:58 +00:00
__init__.py Add Provider protocol and normaliser 2026-04-17 19:20:12 +00:00
_checkpoint.py Add per-account cursor Checkpoint helper 2026-04-17 19:30:20 +00:00
base.py Add Provider protocol and normaliser 2026-04-17 19:20:12 +00:00
fidelity_planviewer.py fidelity: replace snapshot-push with delta gains-offset DEPOSITs 2026-05-17 00:35:17 +00:00
finance_mysql.py Add finance_mysql provider + CLI for historical backfill 2026-04-17 22:38:21 +00:00
imap.py imap: route IE BUYs to ISA first-£20k / GIA overflow per UK tax year 2026-04-18 12:02:49 +00:00
invest_engine.py Add InvestEngineProvider — Bearer-token HTTP client 2026-04-17 21:52:26 +00:00
trading212.py Wire T212 pagination, retries, and click<8.2 pin 2026-04-17 19:45:23 +00:00