feat: unified social identity layer — SocialIdentity, ports, use cases, adapter
SocialIdentity value object (Local|Remote), SocialCommand/SocialQuery domain ports, 11 CQRS use cases w/ 14 tests, CompositeSocialAdapter wrapping k_ap, 6 new domain events, handlers migrated from ap_service to use cases. Closes #12 foundation — AP handlers + legacy cleanup TBD.
This commit is contained in:
18
crates/application/src/social/unblock.rs
Normal file
18
crates/application/src/social/unblock.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use domain::{errors::DomainError, events::DomainEvent, value_objects::UserId};
|
||||
|
||||
use super::{commands::UnblockCommand, deps::SocialCommandDeps};
|
||||
|
||||
pub async fn execute(deps: &SocialCommandDeps, cmd: UnblockCommand) -> Result<(), DomainError> {
|
||||
let blocker = UserId::from_uuid(cmd.blocker_id);
|
||||
deps.social_command.unblock(&blocker, &cmd.target).await?;
|
||||
deps.event_publisher
|
||||
.publish(&DomainEvent::ActorUnblocked {
|
||||
blocker,
|
||||
target: cmd.target,
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "tests/unblock.rs"]
|
||||
mod tests;
|
||||
Reference in New Issue
Block a user