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    pub verbose: bool,
24    pub sort: String,
25    pub sns_count: usize,
26    pub metadata_error_count: usize,
27    pub sns_instances: Vec<SnsListRow>,
28}
29
30///
31/// SnsListRow
32///
33/// Serializable row for one deployed SNS in a list report.
34///
35
36#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
37pub struct SnsListRow {
38    pub id: usize,
39    pub name: String,
40    pub root_canister_id: String,
41    pub governance_canister_id: String,
42    pub ledger_canister_id: String,
43    pub swap_canister_id: String,
44    pub index_canister_id: String,
45    pub metadata_error: Option<String>,
46}
47
48///
49/// SnsInfoReport
50///
51/// Serializable report for one deployed SNS resolved by id or root principal.
52///
53
54#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
55pub struct SnsInfoReport {
56    pub schema_version: u32,
57    pub network: String,
58    pub sns_wasm_canister_id: String,
59    pub fetched_at: String,
60    pub source_endpoint: String,
61    pub fetched_by: String,
62    pub id: usize,
63    pub name: String,
64    pub description: Option<String>,
65    pub url: Option<String>,
66    pub root_canister_id: String,
67    pub governance_canister_id: String,
68    pub ledger_canister_id: String,
69    pub swap_canister_id: String,
70    pub index_canister_id: String,
71    pub metadata_error: Option<String>,
72}