Skip to main content

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

1//! Module: sns::report::model::reports::list
2//!
3//! Responsibility: deployed SNS list and info report DTOs.
4//! Does not own: SNS-W fetching, metadata lookup, sorting, or rendering.
5//! Boundary: preserves raw report fields for text and JSON output writers.
6
7use serde::Serialize;
8
9///
10/// SnsListReport
11///
12/// Serializable report for deployed SNS listings.
13///
14
15#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
16pub struct SnsListReport {
17    pub schema_version: u32,
18    pub network: String,
19    pub sns_wasm_canister_id: String,
20    pub fetched_at: String,
21    pub source_endpoint: String,
22    pub fetched_by: String,
23    /// Whether the rows came from a live collection or the joined catalog cache.
24    pub data_source: String,
25    /// Complete snapshot path when `data_source` is `cache`.
26    pub cache_path: Option<String>,
27    /// Whether the cache provenance represents an API-exhausted complete snapshot.
28    pub cache_complete: Option<bool>,
29    pub verbose: bool,
30    pub sort: String,
31    pub sns_count: usize,
32    pub metadata_error_count: usize,
33    pub sns_instances: Vec<SnsListRow>,
34}
35
36///
37/// SnsListRow
38///
39/// Serializable row for one deployed SNS in a list report.
40///
41
42#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
43pub struct SnsListRow {
44    pub id: usize,
45    pub name: String,
46    pub root_canister_id: String,
47    pub governance_canister_id: String,
48    pub ledger_canister_id: String,
49    pub swap_canister_id: String,
50    pub index_canister_id: String,
51    pub metadata_error: Option<String>,
52}
53
54///
55/// SnsInfoReport
56///
57/// Serializable report for one deployed SNS resolved by id or root principal.
58///
59
60#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
61pub struct SnsInfoReport {
62    pub schema_version: u32,
63    pub network: String,
64    pub sns_wasm_canister_id: String,
65    pub fetched_at: String,
66    pub source_endpoint: String,
67    pub fetched_by: String,
68    pub id: usize,
69    pub name: String,
70    pub description: Option<String>,
71    pub url: Option<String>,
72    pub root_canister_id: String,
73    pub governance_canister_id: String,
74    pub ledger_canister_id: String,
75    pub swap_canister_id: String,
76    pub index_canister_id: String,
77    pub metadata_error: Option<String>,
78}