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#[derive(Clone, Debug, Eq, PartialEq)]
20pub struct SnsProposalsCacheListRequest {
21    pub network: String,
22    pub icp_root: PathBuf,
23}
24
25///
26/// SnsProposalsCacheStatusRequest
27///
28/// Request accepted by the local SNS proposal cache status report builder.
29///
30
31#[derive(Clone, Debug, Eq, PartialEq)]
32pub struct SnsProposalsCacheStatusRequest {
33    pub network: String,
34    pub icp_root: PathBuf,
35    pub input: String,
36}
37
38///
39/// SnsProposalRequest
40///
41/// Request accepted by the direct SNS proposal detail report builder.
42///
43
44#[derive(Clone, Debug, Eq, PartialEq)]
45pub struct SnsProposalRequest {
46    pub network: String,
47    pub source_endpoint: String,
48    pub now_unix_secs: u64,
49    pub input: String,
50    pub proposal_id: u64,
51    pub icp_root: Option<PathBuf>,
52    pub verbose: bool,
53    pub show_ballots: bool,
54}
55
56///
57/// SnsProposalsRequest
58///
59/// Request accepted by the bounded SNS proposal listing report builder.
60///
61
62#[derive(Clone, Debug, Eq, PartialEq)]
63pub struct SnsProposalsRequest {
64    pub network: String,
65    pub source_endpoint: String,
66    pub now_unix_secs: u64,
67    pub input: String,
68    pub limit: u32,
69    pub before_proposal_id: Option<u64>,
70    pub status: SnsProposalStatusFilter,
71    pub topic: SnsProposalTopicFilter,
72    pub eligibility: SnsProposalEligibilityFilter,
73    pub proposer_neuron_id: Option<String>,
74    pub query: Option<String>,
75    pub sort: SnsProposalsSort,
76    pub sort_direction: SnsProposalSortDirection,
77    pub icp_root: Option<PathBuf>,
78    pub verbose: bool,
79}
80
81///
82/// SnsProposalsRefreshRequest
83///
84/// Request accepted by the complete SNS proposal snapshot refresh builder.
85///
86
87#[derive(Clone, Debug, Eq, PartialEq)]
88pub struct SnsProposalsRefreshRequest {
89    pub network: String,
90    pub source_endpoint: String,
91    pub now_unix_secs: u64,
92    pub input: String,
93    pub icp_root: PathBuf,
94    pub page_size: u32,
95    pub max_pages: Option<u32>,
96}