fire-planner/tests
Viktor Barzin ee6ed1d3c4
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
api: expand FastAPI surface for scenarios, networth, life-events, goals, simulate
Adds the read+write endpoints the frontend needs to drive a
ProjectionLab-style UX on top of the existing engine.

- /networth, /networth/history    — NW total + per-account from
                                     account_snapshot (frontend chart)
- /scenarios CRUD + projection    — list/get/create/patch/delete user
                                     scenarios; cartesian read-only
- /scenarios/{id}/life-events     — life event CRUD nested under scenario
- /life-events/{id}               — patch + delete by id
- /scenarios/{id}/goals,
  /goals/{id}                     — retirement goal CRUD
- /simulate, /compare             — sync, no-DB-write what-if endpoints

Auth: Bearer-token dependency on writes + simulate when API_BEARER_TOKEN
is set; reads always open (lock down via Authentik-fronted ingress in
prod). Existing /recompute keeps its bearer auth.

CORS middleware reads FRONTEND_ORIGINS (comma-separated) for the dev
SPA. Lifespan now provisions the SQLAlchemy engine + session_factory
on app.state and disposes them on shutdown.

40 new tests covering happy paths and validation. 172 tests total.
mypy strict + ruff clean (B008 ignore added — Depends() in defaults
is the canonical FastAPI pattern, not a bug).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 21:48:36 +00:00
..
__init__.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
conftest.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_api_life_events_goals.py api: expand FastAPI surface for scenarios, networth, life-events, goals, simulate 2026-05-09 21:48:36 +00:00
test_api_networth.py api: expand FastAPI surface for scenarios, networth, life-events, goals, simulate 2026-05-09 21:48:36 +00:00
test_api_scenarios.py api: expand FastAPI surface for scenarios, networth, life-events, goals, simulate 2026-05-09 21:48:36 +00:00
test_api_simulate.py api: expand FastAPI surface for scenarios, networth, life-events, goals, simulate 2026-05-09 21:48:36 +00:00
test_cli.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_db_schema.py schema: add life_event, retirement_goal; extend scenario with kind/parent 2026-05-09 21:36:58 +00:00
test_e2e.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_ingest_wealthfolio_pg.py ingest: switch wealthfolio to pg-sync mirror reads 2026-05-09 21:33:48 +00:00
test_reporters_pg.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_returns.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_scenarios.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_simulator.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_strategies.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_tax_base.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_tax_other_regimes.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_tax_uk.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00