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::ReportDataSource;
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    pub verbose: bool,
26    pub show_ballots: bool,
27    pub data_source: ReportDataSource,
28    pub cache_path: Option<String>,
29    pub cache_complete: Option<bool>,
30    pub proposal: SnsProposalRow,
31}
32
33///
34/// SnsProposalsReport
35///
36/// Serializable report for a bounded SNS governance proposal listing.
37///
38
39#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
40pub struct SnsProposalsReport {
41    pub schema_version: u32,
42    /// SNS identity and provenance, serialized as flat report fields.
43    #[serde(flatten)]
44    pub context: SnsReportContext,
45    pub requested_limit: u32,
46    pub before_proposal_id: Option<u64>,
47    pub status_filter: String,
48    pub topic_filter: String,
49    pub eligibility_filter: String,
50    pub proposer_filter: Option<String>,
51    pub query_filter: Option<String>,
52    pub sort: String,
53    pub sort_direction: String,
54    pub verbose: bool,
55    pub data_source: ReportDataSource,
56    pub cache_path: Option<String>,
57    pub cache_complete: Option<bool>,
58    pub proposal_count: usize,
59    pub proposals: Vec<SnsProposalRow>,
60}