fix: FollowTarget enum — actor_url no longer lies about holding a handle

FollowCommand.target is now FollowTarget (Identity|Handle) instead of
SocialIdentity. actor_url field always holds a URL; handles go through
FollowTarget::Handle. Adapter resolves handles explicitly. Type system
prevents misuse in future commands.
This commit is contained in:
2026-07-10 16:18:57 +02:00
parent 2484f1e603
commit d60c47199c
18 changed files with 95 additions and 45 deletions

View File

@@ -3,7 +3,7 @@ use std::sync::Arc;
use domain::{
events::DomainEvent,
testing::{InMemorySocialRepository, NoopEventPublisher},
value_objects::{SocialIdentity, UserId},
value_objects::{FollowTarget, SocialIdentity, UserId},
};
use uuid::Uuid;
@@ -40,7 +40,7 @@ async fn accept_follow_emits_follow_accepted_event() {
&deps,
FollowCommand {
follower_id,
target: SocialIdentity::Local(UserId::from_uuid(owner_id)),
target: FollowTarget::Identity(SocialIdentity::Local(UserId::from_uuid(owner_id))),
},
)
.await