Skip to main content

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

1//! Module: sns::report::model::requests::proposals
2//!
3//! Responsibility: request DTOs for SNS proposal reports.
4//! Does not own: command option parsing, live proposal fetches, or rendering.
5//! Boundary: carries validated proposal inputs into SNS report builders.
6
7use crate::sns::report::{
8    SnsProposalEligibilityFilter, SnsProposalSortDirection, SnsProposalStatusFilter,
9    SnsProposalTopicFilter, SnsProposalsSort,
10};
11use std::path::PathBuf;
12
13///
14/// SnsProposalsCacheListRequest
15///
16/// Request accepted by the local SNS proposal cache list report builder.
17///
18
19#[cfg(feature = "host")]
20#[derive(Clone, Debug, Eq, PartialEq)]
21pub struct SnsProposalsCacheListRequest {
22    pub network: String,
23    pub icp_root: PathBuf,
24}
25
26///
27/// SnsProposalsCacheStatusRequest
28///
29/// Request accepted by the local SNS proposal cache status report builder.
30///
31
32#[cfg(feature = "host")]
33#[derive(Clone, Debug, Eq, PartialEq)]
34pub struct SnsProposalsCacheStatusRequest {
35    pub network: String,
36    pub icp_root: PathBuf,
37    pub input: String,
38}
39
40///
41/// SnsProposalRequest
42///
43/// Request accepted by the direct SNS proposal detail report builder.
44///
45
46#[derive(Clone, Debug, Eq, PartialEq)]
47pub struct SnsProposalRequest {
48    pub network: String,
49    pub source_endpoint: String,
50    pub now_unix_secs: u64,
51    pub input: String,
52    pub proposal_id: u64,
53    pub icp_root: Option<PathBuf>,
54    pub verbose: bool,
55    pub show_ballots: bool,
56}
57
58///
59/// SnsProposalsRequest
60///
61/// Request accepted by the bounded SNS proposal listing report builder.
62///
63
64#[derive(Clone, Debug, Eq, PartialEq)]
65pub struct SnsProposalsRequest {
66    pub network: String,
67    pub source_endpoint: String,
68    pub now_unix_secs: u64,
69    pub input: String,
70    pub limit: u32,
71    pub before_proposal_id: Option<u64>,
72    pub status: SnsProposalStatusFilter,
73    pub topic: SnsProposalTopicFilter,
74    pub eligibility: SnsProposalEligibilityFilter,
75    pub proposer_neuron_id: Option<String>,
76    pub query: Option<String>,
77    pub sort: SnsProposalsSort,
78    pub sort_direction: SnsProposalSortDirection,
79    pub icp_root: Option<PathBuf>,
80    pub verbose: bool,
81}
82
83///
84/// SnsProposalsRefreshRequest
85///
86/// Request accepted by the complete SNS proposal snapshot refresh builder.
87///
88
89#[cfg(feature = "host")]
90#[derive(Clone, Debug, Eq, PartialEq)]
91pub struct SnsProposalsRefreshRequest {
92    pub network: String,
93    pub source_endpoint: String,
94    pub now_unix_secs: u64,
95    pub input: String,
96    pub icp_root: PathBuf,
97    pub page_size: u32,
98    pub max_pages: Option<u32>,
99}