import { apiFetch } from './client' import type { Summary, Trends } from '@llm-router/shared' export async function getSummary(month?: string): Promise { const params = new URLSearchParams() if (month) params.set('month', month) const query = params.toString() const res = await apiFetch(`/v1/expense/summary${query ? `?${query}` : ''}`) if (!res.ok) throw new Error('Failed to load summary') return res.json() as Promise } export async function getTrends(months = 6, month?: string): Promise { const params = new URLSearchParams({ months: String(months) }) if (month) params.set('month', month) const res = await apiFetch(`/v1/expense/trends?${params.toString()}`) if (!res.ok) throw new Error('Failed to load trends') return res.json() as Promise }