Monthly budget view with snapshot-from-config and applied tracking #3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Goal
Add per-month budget pages. The existing
/page is the budget configuration: the plan. A month page is a snapshot of that plan for a specific calendar month (YYYY-MM), with an additionalappliedcolumn per entry to track actuals against planned amounts.URL shape
/budget configuration (unchanged)/month/{YYYY-MM}monthly view for that month; 404 with a "Create this month" action if it does not yet existPOST /month/{YYYY-MM}/createcreates the month by snapshotting the current budgetSnapshot semantics
On creation, the month is populated from the current budget:
month_entrypreservingsection,name, andamount(renamedplannedin this context). Applied starts at0.00.source_entry_idpointing back at the budget entry (nullable,ON DELETE SET NULL) so we know where the row came from, even if the budget entry is later deleted.origin_nameandorigin_plannedso we can detect deviation after editing.source_entry_id.After creation, month entries are fully editable: name, planned, applied, and add/delete rows. The debt target can be re-selected per month.
Deviation indicator
Each month entry row compares current
(name, planned)against(origin_name, origin_planned):unchanged: both match, plain row.edited: name or planned differs from origin, annotate the row (e.g. small "modified" label + subtle color tint).new_in_month: no origin (row added after snapshot), annotate as "new this month".Entries whose source budget row has been deleted since snapshot are still
unchanged(the snapshot is self-contained); no special marker for that case.Navigation
/grows a "This month" link to/month/{current_YYYY-MM}and a month picker listing all existing months./.YYYY-MMslugs regardless of whether those months exist; landing on a non-existent one shows the "Create this month" UI.Data model additions
Acceptance criteria
/month/{YYYY-MM}for a non-existent month returns a page with a "Create this month" buttonOut of scope