payslip-ingest/alembic/versions
Viktor Barzin 3a62a38069 rsu_vest_events: schema + ORM for Schwab vest ground truth (Phase D)
Migration 0008 + ORM model for payslip_ingest.rsu_vest_events.

Purpose: broker-sync (separate repo) will parse Schwab "Release
Confirmation" emails and populate this table, enabling Panel 15 of
the UK payslip dashboard to reconcile:
  payslip.rsu_vest   ↔ SUM(rsu_vest_events.gross_value_gbp)
  RSU-attributed PAYE ↔ SUM(rsu_vest_events.tax_withheld_gbp)

Schema carries both the raw USD figures (fmv_at_vest_usd,
tax_withheld_usd, shares_*) and the GBP-translated values
(gross_value_gbp, tax_withheld_gbp) plus the FX rate used — the
dashboard joins on GBP, audits keep USD.

Idempotent on `external_id` — broker-sync emits a stable
`schwab:{date}:{ticker}:VEST:{shares_vested}` for each vest event.

The broker-sync postgres sink that writes here is pending a real email
fixture (current parser is heuristic-only) and a cross-service DB grant
for broker-sync's K8s ServiceAccount. Follow-up under code-860.

Part of: code-860
2026-04-19 18:27:41 +00:00
..
0001_initial.py v2: regex parser for Meta UK template + accurate RSU tax attribution 2026-04-19 10:53:52 +00:00
0002_add_rsu_columns.py alembic 0002: fix down_revision to '0001' (matches 0001_initial's id) 2026-04-18 23:41:29 +00:00
0003_earnings_breakdown.py v2: regex parser for Meta UK template + accurate RSU tax attribution 2026-04-19 10:53:52 +00:00
0004_cash_income_tax.py parser + P60 ingest: split income_tax cash/RSU, add P60 ground-truth 2026-04-19 15:23:05 +00:00
0005_p60_reference.py parser + P60 ingest: split income_tax cash/RSU, add P60 ground-truth 2026-04-19 15:23:05 +00:00
0006_cash_income_tax_source.py backfill: cash_income_tax back-fill for variant-A NULL rows 2026-04-19 18:15:18 +00:00
0007_external_meta_deposits.py sync: ActualBudget Meta deposit overlay (Phase C) 2026-04-19 18:20:50 +00:00
0008_rsu_vest_events.py rsu_vest_events: schema + ORM for Schwab vest ground truth (Phase D) 2026-04-19 18:27:41 +00:00