//! Account domain logic — account deletion with KT tombstone. use std::sync::{Arc, Mutex}; use quicprochat_kt::MerkleLog; use crate::storage::Store; use super::types::DomainError; /// Domain service for account lifecycle operations. pub struct AccountService { pub store: Arc, pub kt_log: Arc>, } impl AccountService { pub fn delete_account(&self, caller_identity_key: &[u8]) -> Result<(), DomainError> { self.store.delete_account(caller_identity_key)?; // Append a KT tombstone entry so the deletion is auditable. if let Ok(mut log) = self.kt_log.lock() { log.append("__tombstone__", caller_identity_key); } Ok(()) } }