Monthly budget view with snapshot and applied tracking #4
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/3-monthly-view"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #3 (will be manually closed on merge).
Summary
Adds per-month budget pages that snapshot the budget at creation and track actuals against planned amounts. The existing
/page remains the budget configuration./month/YYYY-MMrenders the month; non-existent months return a single-button create flowPOST /month/YYYY-MM/createsnapshots every budget entry and the current debt target, then redirects viaHX-Redirectunchanged,edited(orange tint + "modified" tag),new_in_month(blue tint + "new this month" tag)Schema additions
Snapshot preserves
origin_name/origin_plannedso the UI can flag rows that have been edited since the copy.source_entry_idis informational only after creation; deleting the referenced budget row sets it null without affecting the month's data (deviation still reportsunchanged, since the snapshot is self-contained).Test plan
uv run pytestpasses (36/36, +23 new)uv run alembic upgrade headapplies both migrations cleanly/month/2026-04for missing month shows "No snapshot yet" with create buttonPOST /month/2026-04/createreturns 204 withHX-Redirectstate-unchangedrowsPOST /month/2026-04/entries/{id}withplanned=...flips row tostate-editedand renders the modified tagPOSTwithapplied=...updates the total applied without touching plannedPOSTto/month/2026-04/sections/other/entriesadds a row withstate-new_in_monthPOST /month/2026-04/targetchanges the per-month targetGET /month/2026-13returns 404Out of scope
2d7ce333eatob2d16120d2