Add Organization aggregate (client-as-status), wired but inert
Deploy / deploy (push) Successful in 34s

Prospect -> Client -> PastClient (Prospect -> PastClient allowed
directly too - a prospect that never converted). "Client" is a status
on Organization, not a separate aggregate, per the event-sourcing
plan's design decision. Wired into the same dispatch points as the
other three aggregates (content.rs's bucket map, answers.rs's
create/transition dispatch) so it's ready the moment content
references an "organizations" bucket - nothing does yet, so this lands
compiled and tested but with zero production surface.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Bendik Aagaard Lynghaug
2026-08-06 12:01:17 +02:00
co-authored by Claude Sonnet 5
parent 755b796ad1
commit aa18c69be4
4 changed files with 54 additions and 2 deletions
+2
View File
@@ -345,6 +345,7 @@ pub fn aggregate_type_for_bucket(bucket: &str) -> Option<&'static str> {
"applicants" => Some("applicant"),
"subscribers" => Some("subscriber"),
"projects" => Some("project"),
"organizations" => Some("organization"),
_ => None,
}
}
@@ -359,6 +360,7 @@ fn is_valid_transition_target(aggregate_type: &str, to: &str) -> bool {
"applicant" => check::<crate::aggregates::applicant::State>(to),
"subscriber" => check::<crate::aggregates::subscriber::State>(to),
"project" => check::<crate::aggregates::project::State>(to),
"organization" => check::<crate::aggregates::organization::State>(to),
_ => false,
}
}