Frontend: preview distribution #56

Open
opened 2026-06-26 00:04:31 +02:00 by myrmidex · 0 comments
Owner

Context

Split from #34. A user enters an income amount and sees how it would distribute across their buckets — without persisting. Uses the existing stateless preview endpoint.

Scope

  • Income-amount input on the scenario show page.
  • Submit → POST /api/scenarios/{scenario}/projections/preview (application/ld+json, body {amount}) → render the ProjectionPreviewOutput (per-bucket allocations + totals).
  • Drive the DigitalProgressBar visuals from the preview result (show projected fill per bucket).
  • Owner-scoped: previewing a scenario you don't own returns 404 (#50 Story 4) — handled by the not-found state from #53.

Notes

  • The endpoint is STATELESS — nothing is saved; it's a pure projection (see PLATFORM.md "Allocation Preview" + the #32 engine).
  • This is the showcase flow for the allocation engine (#32) — the phased fill order, overflow handling, etc. become visible here.

Depends on

  • #33 (scaffold), #53 (scenario show page with buckets to project onto)

Out of scope

  • Persisting an allocation / actually distributing income (the preview is read-only by design; a persist flow would be a separate future ticket once a "commit allocation" backend op exists).

Testing

  • Per SPA test setup; preview render from a mocked result + the 404 path.
## Context Split from #34. A user enters an income amount and sees how it would distribute across their buckets — without persisting. Uses the existing stateless preview endpoint. ## Scope - Income-amount input on the scenario show page. - Submit → `POST /api/scenarios/{scenario}/projections/preview` (`application/ld+json`, body `{amount}`) → render the `ProjectionPreviewOutput` (per-bucket allocations + totals). - Drive the DigitalProgressBar visuals from the preview result (show projected fill per bucket). - Owner-scoped: previewing a scenario you don't own returns 404 (#50 Story 4) — handled by the not-found state from #53. ## Notes - The endpoint is STATELESS — nothing is saved; it's a pure projection (see PLATFORM.md "Allocation Preview" + the #32 engine). - This is the showcase flow for the allocation engine (#32) — the phased fill order, overflow handling, etc. become visible here. ## Depends on - #33 (scaffold), #53 (scenario show page with buckets to project onto) ## Out of scope - Persisting an allocation / actually distributing income (the preview is read-only by design; a persist flow would be a separate future ticket once a "commit allocation" backend op exists). ## Testing - Per SPA test setup; preview render from a mocked result + the 404 path.
myrmidex added this to the v0.3.0 milestone 2026-06-26 00:04:31 +02:00
myrmidex added the
enhancement
label 2026-06-26 00:04:31 +02:00
myrmidex self-assigned this 2026-06-26 00:04:31 +02:00
myrmidex added a new dependency 2026-06-26 00:11:25 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: lvl0/buckets#56
No description provided.