Skip to main content

ic_query/sns/report/model/reports/proposals/
report.rs

1//! Module: sns::report::model::reports::proposals::report
2//!
3//! Responsibility: define SNS proposal list and detail report DTOs.
4//! Does not own: live governance calls, row conversion, cache reads, or rendering.
5//! Boundary: preserves report-level fields for text and JSON output.
6
7use super::row::SnsProposalRow;
8use crate::report::ReportProvenance;
9use crate::sns::report::SnsReportContext;
10use serde::Serialize;
11
12///
13/// SnsProposalReport
14///
15/// Serializable report for one SNS governance proposal detail lookup.
16///
17
18#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
19pub struct SnsProposalReport {
20    pub schema_version: u32,
21    /// SNS identity and provenance, serialized as flat report fields.
22    #[serde(flatten)]
23    pub context: SnsReportContext,
24    pub proposal_id: u64,
25    /// Shared record, flattened in serialized output.
26    #[serde(flatten)]
27    pub provenance: ReportProvenance,
28    pub proposal: SnsProposalRow,
29}
30
31///
32/// SnsProposalsReport
33///
34/// Serializable report for a bounded SNS governance proposal listing.
35///
36
37#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
38pub struct SnsProposalsReport {
39    pub schema_version: u32,
40    /// SNS identity and provenance, serialized as flat report fields.
41    #[serde(flatten)]
42    pub context: SnsReportContext,
43    pub requested_limit: u32,
44    pub before_proposal_id: Option<u64>,
45    pub status_filter: String,
46    pub topic_filter: String,
47    pub eligibility_filter: String,
48    pub proposer_filter: Option<String>,
49    pub query_filter: Option<String>,
50    pub sort: String,
51    pub sort_direction: String,
52    /// Shared record, flattened in serialized output.
53    #[serde(flatten)]
54    pub provenance: ReportProvenance,
55    pub proposals: Vec<SnsProposalRow>,
56}