Skip to content

feat(budgets,analytics): close PRD §6.3 and §6.6 - #8

Merged
theprogrammersingh merged 2 commits into
mainfrom
feat/budgets-depth-analytics
Sep 3, 2026
Merged

feat(budgets,analytics): close PRD §6.3 and §6.6#8
theprogrammersingh merged 2 commits into
mainfrom
feat/budgets-depth-analytics

Conversation

@theprogrammersingh

Copy link
Copy Markdown
Owner

Closes PRD §6.3 (Budgets) and §6.6 (Analytics).

Budgets

  • PATCH /api/budgets/:id — budgets were create-only
  • Rollover carry: declared + max(0, prevDeclared − prevSpent), prior month only. Unspent carries; overspend never becomes debt
  • 80% threshold alerts — row badge, dashboard notice, atWarningThreshold on get_budget_status
  • Form is now upsert: edit amount and rollover per category

Analytics

  • GET /api/analytics/summary — month totals, MoM delta, per-category breakdown
  • get_spend_summary WebMCP tool

Also

  • isSpend() now excludes drafts, matching the server. The two disagreed, so the dashboard and budgets page could report different totals for the same data.
  • dev:clean + CLAUDE.md note: adding an export to @actuo/shared leaves Vite's prebundle stale, which blanks the whole app with no test able to catch it.

1,006 tests pass (12 shared / 142 backend / 37 e2e / 815 frontend). Verified live — the Software budget renders ₹25,000 + ₹12,295 carried.

Vite prebundles @actuo/shared (a workspace symlink) and invalidates that
cache on lockfile/config, not on the package's contents — so adding an
export rebuilt shared/dist while the dev server kept serving the old
prebundle. The SyntaxError throws at module evaluation, so the whole app
renders blank rather than reporting a module problem.

No test catches it: pnpm test never reads the dev server's cache.
Budgets: PATCH /api/budgets/:id, rollover carry, 80% threshold alerts.
Carry is declared + max(0, prevDeclared - prevSpent) from the prior
month only — unspent carries, overspend never becomes debt.

Analytics: GET /api/analytics/summary (month totals, MoM delta,
per-category breakdown) and a get_spend_summary WebMCP tool.

Also aligns frontend isSpend() with the server rule so drafts are
excluded everywhere — the two disagreed, so the dashboard and the
budgets page could report different totals for the same data.

BudgetStatus gains declaredBudget/carryforward so the UI can state the
carry rather than show an unexplained larger number.
@theprogrammersingh
theprogrammersingh merged commit 55fb416 into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant