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 <noreply@anthropic.com>
This commit is contained in:
parent
5ed9c52929
commit
54f6f66ff8
1 changed files with 5 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ from app.db.models import (
|
||||||
InvestmentTransaction, ManualCGTDisposal, NetWorthSnapshot, Payslip,
|
InvestmentTransaction, ManualCGTDisposal, NetWorthSnapshot, Payslip,
|
||||||
TaxProfile, Transaction, User,
|
TaxProfile, Transaction, User,
|
||||||
)
|
)
|
||||||
|
from app.services.tax_service import seed_default_rates
|
||||||
|
|
||||||
DEMO_EMAIL = "demo@mymidas.app"
|
DEMO_EMAIL = "demo@mymidas.app"
|
||||||
DEMO_PASSWORD = "demo123"
|
DEMO_PASSWORD = "demo123"
|
||||||
|
|
@ -509,6 +510,10 @@ async def seed_demo(db: AsyncSession) -> None:
|
||||||
|
|
||||||
await db.flush()
|
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) ───────
|
# ── Historical net worth snapshots (weekly, Oct 2025 → present) ───────
|
||||||
# Plausible progression: cash + growing investment portfolio, salary in
|
# Plausible progression: cash + growing investment portfolio, salary in
|
||||||
# each month, large purchases (car insurance Oct, Christmas Dec, etc.)
|
# each month, large purchases (car insurance Oct, Christmas Dec, etc.)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue