diff --git a/crates/buzz-db/src/lib.rs b/crates/buzz-db/src/lib.rs index c71255833d9..38a7d5afd7a 100644 --- a/crates/buzz-db/src/lib.rs +++ b/crates/buzz-db/src/lib.rs @@ -1335,25 +1335,6 @@ impl Db { Ok(result.rows_affected()) } - /// Sidecar an accepted product-feedback event, idempotent by event id. - #[datastore_span(name = "insert_product_feedback", system = "postgresql")] - pub async fn insert_product_feedback( - &self, - community: CommunityId, - feedback: product_feedback::NewProductFeedback<'_>, - ) -> Result { - product_feedback::insert(&self.pool, community, feedback).await - } - - /// List product feedback across the deployment, newest first. - #[datastore_span(name = "list_product_feedback", system = "postgresql")] - pub async fn list_product_feedback( - &self, - limit: i64, - ) -> Result> { - product_feedback::list(&self.pool, limit).await - } - /// Insert a tenant-scoped NIP-56 report row, idempotent by report event id. #[datastore_span(name = "insert_moderation_report", system = "postgresql")] pub async fn insert_moderation_report( diff --git a/crates/buzz-db/src/product_feedback.rs b/crates/buzz-db/src/product_feedback.rs index 1a9f45e62b3..8a0ef36bea5 100644 --- a/crates/buzz-db/src/product_feedback.rs +++ b/crates/buzz-db/src/product_feedback.rs @@ -3,12 +3,13 @@ //! Feedback retains its source [`CommunityId`] as provenance, but is not a //! community moderation concern and is never inserted into the events table. +use buzz_datastore_tracing::datastore_span; use chrono::{DateTime, Utc}; use serde::Serialize; use sqlx::{PgPool, Row as _}; use uuid::Uuid; -use crate::{error::Result, CommunityId}; +use crate::{error::Result, CommunityId, Db}; /// Validated fields from an accepted product-feedback event. #[derive(Debug, Clone)] @@ -117,6 +118,24 @@ pub async fn list(pool: &PgPool, limit: i64) -> Result, + ) -> Result { + insert(&self.pool, community, feedback).await + } + + /// List product feedback across the deployment, newest first. + #[datastore_span(name = "list_product_feedback", system = "postgresql")] + pub async fn list_product_feedback(&self, limit: i64) -> Result> { + list(&self.pool, limit).await + } +} + #[cfg(test)] mod tests { use super::*;