Save income distribution to bucket balances #19
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?
Problem
The income distribution preview (#12) shows how income would spread across buckets, but there's no way to persist the result. After the user distributes money in their bank accounts, they need to click Save to update bucket balances so the next preview reflects current fill levels.
Approach
Add a "Save Distribution" button to the preview results. On click, send the allocation data to a new endpoint that updates each bucket's
starting_amountby adding the allocated amount.Keep it simple: no Draw or Inflow records, just update
starting_amountdirectly. Ledger entries are a future concern.Scope
Backend:
POST /scenarios/{scenario}/projections/apply(or similar)amountas the preview, re-runsallocateInflow()to compute allocations server-side (don't trust client-sent allocation amounts)starting_amount += allocated_amountFrontend:
IncomeDistributionPreviewcomponent, visible only when preview results are shownAcceptance criteria
starting_amountincreases by its allocated amount