feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready (#1)
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled

This commit was merged in pull request #1.
This commit is contained in:
2026-05-16 09:42:40 +00:00
parent 071809bc3f
commit 9aee4ceb6d
224 changed files with 35418 additions and 1469 deletions

View File

@@ -0,0 +1,86 @@
use crate::value_objects::{BoostId, LikeId, ThoughtId, UserId};
#[derive(Debug, Clone)]
pub enum DomainEvent {
ThoughtCreated {
thought_id: ThoughtId,
user_id: UserId,
in_reply_to_id: Option<ThoughtId>,
},
ThoughtDeleted {
thought_id: ThoughtId,
user_id: UserId,
},
ThoughtUpdated {
thought_id: ThoughtId,
user_id: UserId,
},
LikeAdded {
like_id: LikeId,
user_id: UserId,
thought_id: ThoughtId,
},
LikeRemoved {
user_id: UserId,
thought_id: ThoughtId,
},
BoostAdded {
boost_id: BoostId,
user_id: UserId,
thought_id: ThoughtId,
},
BoostRemoved {
user_id: UserId,
thought_id: ThoughtId,
},
FollowRequested {
follower_id: UserId,
following_id: UserId,
},
FollowAccepted {
follower_id: UserId,
following_id: UserId,
},
FollowRejected {
follower_id: UserId,
following_id: UserId,
},
Unfollowed {
follower_id: UserId,
following_id: UserId,
},
UserBlocked {
blocker_id: UserId,
blocked_id: UserId,
},
UserUnblocked {
blocker_id: UserId,
blocked_id: UserId,
},
UserRegistered {
user_id: UserId,
},
ProfileUpdated {
user_id: UserId,
},
MentionReceived {
thought_id: ThoughtId,
mentioned_user_id: UserId,
author_user_id: UserId,
},
}
pub struct EventEnvelope {
pub event: DomainEvent,
pub delivery_count: u64,
pub ack: Box<dyn Fn() + Send + Sync>,
pub nack: Box<dyn Fn() + Send + Sync>,
}
impl std::fmt::Debug for EventEnvelope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("EventEnvelope")
.field("event", &self.event)
.field("delivery_count", &self.delivery_count)
.finish()
}
}