From 54f6f66ff802df2e9a63deb9a5ea60abfed7efb5 Mon Sep 17 00:00:00 2001 From: megaproxy Date: Thu, 23 Apr 2026 23:03:19 +0000 Subject: [PATCH] Fix demo tax page: seed UK tax rate configs for demo user The demo user was created after migrations ran, so TaxRateConfig rows were never inserted for them. seed_demo() now calls seed_default_rates() to add 2025 and 2026 UK defaults, making the tax report page load. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/demo/seed.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/app/demo/seed.py b/backend/app/demo/seed.py index de1a889..ac559cc 100644 --- a/backend/app/demo/seed.py +++ b/backend/app/demo/seed.py @@ -15,6 +15,7 @@ from app.db.models import ( InvestmentTransaction, ManualCGTDisposal, NetWorthSnapshot, Payslip, TaxProfile, Transaction, User, ) +from app.services.tax_service import seed_default_rates DEMO_EMAIL = "demo@mymidas.app" DEMO_PASSWORD = "demo123" @@ -509,6 +510,10 @@ async def seed_demo(db: AsyncSession) -> None: await db.flush() + # ── Tax rate configs (2025 + 2026 UK defaults) ──────────────────────── + await seed_default_rates(db, uid) + await db.flush() + # ── Historical net worth snapshots (weekly, Oct 2025 → present) ─────── # Plausible progression: cash + growing investment portfolio, salary in # each month, large purchases (car insurance Oct, Christmas Dec, etc.)