Add recurring transaction detection, subscriptions page, and UK tax reporting

- Recurring service: auto-detects direct debits/subscriptions from CSV imports
  using frequency analysis; manual toggle in transaction detail drawer
- Subscriptions page (/subscriptions): groups recurring payments with monthly
  cost equivalents, next-payment badges, and re-scan trigger
- UK Tax page (/tax): payslips/P60 entry, income tax + NI + CGT + dividend tax
  calculations, configurable rate tables per tax year (pre-seeded 2024/25 and
  2025/26), editable in-app so Budget changes need no rebuild
- Migration 0006: tax_rate_configs, tax_profiles, payslips, manual_cgt_disposals
  with RLS; seeds 2025/2026 rate configs for existing users
- Chart tooltip fix: all Recharts tooltips now use TOOLTIP_STYLE constant so
  they render correctly across all dark/light themes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-04-23 21:40:02 +00:00
parent 0b326cbd87
commit afb5e99bb2
48 changed files with 6238 additions and 39 deletions

View file

@ -10,6 +10,20 @@ const COLORS = [
"#f59e0b","#8b5cf6","#06b6d4","#84cc16","#ef4444",
];
const TOOLTIP_STYLE = {
contentStyle: {
background: "hsl(var(--card))",
border: "1px solid hsl(var(--border))",
borderRadius: "8px",
fontSize: "12px",
color: "hsl(var(--foreground))",
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
},
labelStyle: { color: "hsl(var(--foreground))", fontWeight: 500, marginBottom: "4px" },
itemStyle: { color: "hsl(var(--muted-foreground))" },
cursor: { fill: "hsl(var(--muted-foreground))", fillOpacity: 0.08 },
};
const TYPE_COLORS: Record<string, string> = {
stock: "#6366f1",
etf: "#22c55e",
@ -181,16 +195,11 @@ export function CostVsValueChart({ portfolio }: { portfolio: PortfolioSummary })
width={52}
/>
<Tooltip
{...TOOLTIP_STYLE}
formatter={(value: number, name: string) => [
formatCurrency(value, portfolio.currency),
name === "cost" ? "Cost basis" : "Current value",
]}
contentStyle={{
background: "hsl(var(--card))",
border: "1px solid hsl(var(--border))",
borderRadius: "8px",
fontSize: "12px",
}}
/>
<Bar dataKey="cost" name="cost" fill="hsl(var(--muted-foreground))" opacity={0.4} radius={[4, 4, 0, 0]} barSize={20} />
<Bar dataKey="value" name="value" radius={[4, 4, 0, 0]} barSize={20}>
@ -265,13 +274,8 @@ export function ReturnChart({ portfolio }: { portfolio: PortfolioSummary }) {
/>
<ReferenceLine x={0} stroke="hsl(var(--border))" strokeWidth={1.5} />
<Tooltip
{...TOOLTIP_STYLE}
formatter={(value: number) => [`${Number(value).toFixed(2)}%`, "Return"]}
contentStyle={{
background: "hsl(var(--card))",
border: "1px solid hsl(var(--border))",
borderRadius: "8px",
fontSize: "12px",
}}
/>
<Bar dataKey="pct" radius={[0, 4, 4, 0]} barSize={18}>
<LabelList