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