2026-08-11 21:42:57 +02:00
|
|
|
# The full state graph for every bucket that wants event-sourced,
|
|
|
|
|
# CAS-protected transitions - see portal's src/aggregates/mod.rs. A
|
|
|
|
|
# bucket with no entry here still works (plain KV mutate-in-place, no
|
|
|
|
|
# event log). `bucket` doubles as both the KV bucket name and the
|
|
|
|
|
# JetStream event-subject segment (events.<bucket>.<id>) - one name,
|
|
|
|
|
# not two.
|
|
|
|
|
#
|
|
|
|
|
# Pages (review.yaml, subscribed.yaml, index.yaml) reference these
|
|
|
|
|
# bucket names and `to:` state names by string; they never re-declare
|
|
|
|
|
# the graph itself. Add a new aggregate here alone - no portal code
|
|
|
|
|
# change needed.
|
|
|
|
|
aggregates:
|
2026-08-12 22:04:11 +02:00
|
|
|
# One continuous graph per person, applicant through employee - the
|
|
|
|
|
# bucket name stays "applicants" even as a record progresses past the
|
|
|
|
|
# applying stage (a deliberate trade: one chain of events per person,
|
|
|
|
|
# no identity-linking between separate buckets).
|
2026-08-11 21:42:57 +02:00
|
|
|
- bucket: applicants
|
|
|
|
|
initial: open
|
|
|
|
|
states:
|
|
|
|
|
open: { event: applied }
|
|
|
|
|
invited: { event: invited }
|
|
|
|
|
declined: { event: declined }
|
2026-08-12 22:04:11 +02:00
|
|
|
active: { event: onboarded }
|
|
|
|
|
departed: { event: departed }
|
2026-08-11 21:42:57 +02:00
|
|
|
transitions:
|
|
|
|
|
open: [invited, declined]
|
2026-08-12 22:04:11 +02:00
|
|
|
invited: [active, declined]
|
|
|
|
|
active: [departed]
|
2026-08-11 21:42:57 +02:00
|
|
|
|
|
|
|
|
- bucket: subscribers
|
|
|
|
|
initial: open
|
|
|
|
|
states:
|
|
|
|
|
open: { event: subscribed }
|
|
|
|
|
unsubscribed: { event: unsubscribed }
|
|
|
|
|
transitions:
|
|
|
|
|
open: [unsubscribed]
|
|
|
|
|
|
|
|
|
|
- bucket: projects
|
|
|
|
|
initial: open
|
|
|
|
|
states:
|
|
|
|
|
open: { event: submitted }
|
|
|
|
|
accepted: { event: accepted }
|
|
|
|
|
declined: { event: declined }
|
|
|
|
|
transitions:
|
|
|
|
|
open: [accepted, declined]
|
|
|
|
|
|
|
|
|
|
- bucket: organizations
|
|
|
|
|
initial: prospect
|
|
|
|
|
states:
|
|
|
|
|
prospect: { event: identified }
|
|
|
|
|
client: { event: became_client }
|
|
|
|
|
past_client: { event: churned }
|
|
|
|
|
transitions:
|
|
|
|
|
prospect: [client, past_client]
|
|
|
|
|
client: [past_client]
|
2026-08-12 22:04:11 +02:00
|
|
|
|
|
|
|
|
# Proposals to change this very repo - the question architecture
|
|
|
|
|
# dogfooding its own development. Approval hands off to an n8n
|
|
|
|
|
# automation that opens a PR against this repo (see the infrastructure
|
|
|
|
|
# repo's development-commit workflow); the lint CI gates the merge.
|
|
|
|
|
- bucket: development_proposals
|
|
|
|
|
initial: open
|
|
|
|
|
states:
|
|
|
|
|
open: { event: proposed }
|
|
|
|
|
approved: { event: approved }
|
|
|
|
|
rejected: { event: rejected }
|
|
|
|
|
transitions:
|
|
|
|
|
open: [approved, rejected]
|