use super::super::native_helpers::{NativeEventContext, enqueue_outbox_event_with_context};
use super::VaultServiceImpl;
impl VaultServiceImpl {
#[allow(clippy::too_many_arguments)]
pub(crate) async fn emit(
&self,
topic: &str,
partition_key: &str,
tenant_id: &str,
project_id: &str,
operation: &str,
target_resource: &str,
payload: serde_json::Value,
) {
let Some(pool) = self.pg_pool.as_ref() else {
return;
};
enqueue_outbox_event_with_context(
pool,
self.outbox_relation.as_deref(),
topic,
partition_key,
tenant_id,
project_id,
payload,
NativeEventContext {
operation: operation.to_string(),
outcome: "allow".to_string(),
target_resource: target_resource.to_string(),
..NativeEventContext::default()
},
Some(&self.metrics),
)
.await;
}
}