feat(budgets,analytics): close PRD §6.3 and §6.6 - #8
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes PRD §6.3 (Budgets) and §6.6 (Analytics).
Budgets
PATCH /api/budgets/:id— budgets were create-onlydeclared + max(0, prevDeclared − prevSpent), prior month only. Unspent carries; overspend never becomes debtatWarningThresholdonget_budget_statusAnalytics
GET /api/analytics/summary— month totals, MoM delta, per-category breakdownget_spend_summaryWebMCP toolAlso
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/sharedleaves 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.