Frontend: add income stream #55

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

Context

Split from #34. A user can add an income/expense stream to a scenario. Uses the existing POST /api/streams.

Scope

  • Add-stream form: name, amount, type (StreamType), frequency (StreamFrequency), startDate, optional endDate, optional bucket, isActive.
  • Submit → POST /api/streams (application/ld+json) referencing the scenario IRI and (optionally) a bucket IRI.
  • On success: stream appears in the income panel (refetch or optimistic insert).
  • Validation errors surfaced inline from the 422 body.

Notes

  • Stream's bucket is OPTIONAL (income streams are scenario-wide, bucket=null; expense streams may earmark a bucket — see PLATFORM.md Stream domain).
  • A foreign scenario OR foreign bucket IRI returns 400 (unresolvable — see PLATFORM.md). UI only offers the user's own scenario/buckets, so this is an edge guard.
  • The cross-scenario invariant (bucket and scenario must match) is NOT yet enforced server-side — tracked as #51. The UI should only offer buckets belonging to the current scenario to avoid creating the inconsistency in the first place.

Depends on

  • #33 (scaffold), #53 (scenario show page)

Out of scope

  • Editing/deleting streams (no backend op yet).

Testing

  • Per SPA test setup; happy path (with and without bucket) + validation error render.
## Context Split from #34. A user can add an income/expense stream to a scenario. Uses the existing `POST /api/streams`. ## Scope - Add-stream form: name, amount, type (StreamType), frequency (StreamFrequency), startDate, optional endDate, optional bucket, isActive. - Submit → `POST /api/streams` (`application/ld+json`) referencing the scenario IRI and (optionally) a bucket IRI. - On success: stream appears in the income panel (refetch or optimistic insert). - Validation errors surfaced inline from the 422 body. ## Notes - Stream's `bucket` is OPTIONAL (income streams are scenario-wide, bucket=null; expense streams may earmark a bucket — see PLATFORM.md Stream domain). - A foreign scenario OR foreign bucket IRI returns **400** (unresolvable — see PLATFORM.md). UI only offers the user's own scenario/buckets, so this is an edge guard. - The cross-scenario invariant (bucket and scenario must match) is NOT yet enforced server-side — tracked as #51. The UI should only offer buckets belonging to the current scenario to avoid creating the inconsistency in the first place. ## Depends on - #33 (scaffold), #53 (scenario show page) ## Out of scope - Editing/deleting streams (no backend op yet). ## Testing - Per SPA test setup; happy path (with and without bucket) + validation error render.
myrmidex added this to the v0.3.0 milestone 2026-06-26 00:04:19 +02:00
myrmidex added the
enhancement
label 2026-06-26 00:04:19 +02:00
myrmidex self-assigned this 2026-06-26 00:04:19 +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#55
No description provided.