use serde::{Deserialize, Serialize}; use uuid::Uuid; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ActorContext { pub user_id: Uuid, pub space_id: Uuid, pub project_id: Option, } impl ActorContext { pub fn new(user_id: Uuid, space_id: Uuid) -> Self { Self { user_id, space_id, project_id: None, } } pub fn with_project(mut self, project_id: Uuid) -> Self { self.project_id = Some(project_id); self } pub fn require_project(&self) -> Result { self.project_id.ok_or("project_id missing in actor context") } }