use crate::snapshot_cache::{SnapshotEnvelope, SnapshotHeader, SnapshotRefreshAttempt};
use crate::sns::report::{SnsProposalRow, cache_attempt::SnsRefreshAttemptMetadata};
use serde::{Deserialize as SerdeDeserialize, Serialize};
pub(super) type SnsProposalsCache =
SnapshotEnvelope<SnsProposalsCacheMetadata, SnsProposalsCacheRows>;
pub(super) type SnsProposalsCacheHeader = SnapshotHeader<SnsProposalsCacheHeaderMetadata>;
pub(super) type SnsProposalsRefreshAttempt = SnapshotRefreshAttempt<SnsRefreshAttemptMetadata>;
#[derive(Clone, Debug, Eq, PartialEq, SerdeDeserialize, Serialize)]
pub(super) struct SnsProposalsCacheMetadata {
pub(super) sns_wasm_canister_id: String,
pub(super) id: usize,
pub(super) name: String,
pub(super) root_canister_id: String,
pub(super) governance_canister_id: String,
}
#[derive(Clone, Debug, Eq, PartialEq, SerdeDeserialize, Serialize)]
pub(super) struct SnsProposalsCacheRows {
pub(super) proposals: Vec<SnsProposalRow>,
}
#[derive(Clone, Debug, Eq, PartialEq, SerdeDeserialize)]
pub(super) struct SnsProposalsCacheHeaderMetadata {
pub(super) id: usize,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub(super) struct CompleteSnsProposals {
pub(super) proposals: Vec<SnsProposalRow>,
pub(super) page_count: u32,
pub(super) last_cursor: Option<String>,
}