broker-sync/tests
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
..
fixtures fidelity-planviewer: wire provider to real PlanViewer session + JSON API 2026-04-18 18:47:38 +00:00
providers fidelity: replace snapshot-push with delta gains-offset DEPOSITs 2026-05-17 00:35:17 +00:00
sinks fidelity: push per-fund manual snapshot instead of gains-offset DEPOSIT 2026-05-16 13:56:25 +00:00
__init__.py Initial scaffold + canonical Activity model 2026-04-17 19:16:11 +00:00
test_cli.py Add broker-sync invest-engine CLI subcommand 2026-04-17 21:59:31 +00:00
test_dedup.py Add SyncRecordStore for authoritative dedup 2026-04-17 19:17:12 +00:00
test_fx.py Add FxCache and convert_to_gbp core 2026-04-17 19:18:41 +00:00
test_fx_ecb.py Add ECB FX fetcher + cache population 2026-04-17 19:32:23 +00:00
test_models.py Initial scaffold + canonical Activity model 2026-04-17 19:16:11 +00:00
test_normaliser.py Add Provider protocol and normaliser 2026-04-17 19:20:12 +00:00
test_pipeline.py pipeline: emit matching DEPOSIT/WITHDRAWAL for every BUY/SELL 2026-04-18 19:12:49 +00:00