read.markets/app/services
Giorgio Gilestro 8a155ef157 phase B (2/2): CSV upload endpoint + drag-drop UI
Completes Phase B. The full alternative-onboarding flow is now end-to-end:
drop a T212 pie CSV → parser → InstrumentMap resolver → PortfolioSnapshot
+ Position rows, all without ever asking the user for broker credentials.

- persist_pie() in app/services/csv_import.py: takes a ParsedPie, resolves
  each Slice via InstrumentMap, writes Portfolio + Snapshot + Position
  rows. Unmapped slices are still persisted using their CSV values and
  surfaced in the response for the UI to warn about.
- POST /api/portfolios/upload: multipart endpoint accepting CSV file +
  optional portfolio_name + currency. 2 MiB cap. Returns import summary.
- /upload page with drag-drop dropzone, file input fallback, and inline
  result panel showing invested/value/result + unmapped-slice warnings.
- New "Import" link in the header nav.

Verified end-to-end against the real T212 export: all 13 positions land
with correct T212 tickers (incl. FPp_EQ for the Paris TotalEnergies
listing the heuristic resolver picks), zero unmapped slices, totals
reconcile to the penny.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 11:00:42 +01:00
..
__init__.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
cadence.py cadence: support multiple active windows; Asia window commented out 2026-05-16 10:20:05 +01:00
csv_import.py phase B (2/2): CSV upload endpoint + drag-drop UI 2026-05-16 11:00:42 +01:00
feeds_bootstrap.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
instrument_map.py phase B (1/4): CSV parser + InstrumentMap (T212 shortcode → Yahoo ticker) 2026-05-16 10:53:08 +01:00
market.py add ECB Data Portal source; group-aware stale thresholds 2026-05-15 23:13:58 +01:00
markets.py add Eurostat + UK ONS sources; valuation/bubble/economy/bonds groups; aggregate read; market-open header 2026-05-15 23:07:42 +01:00
news.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
openrouter.py market-aware AI cadence + incremental log updates 2026-05-16 10:17:39 +01:00
trading212.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00