Skip to main content

polyester/models/
lifecycle.rs

1//! Lifecycle flow models (Go `models/trading.go` lifecycle parity).
2
3/// Specific Zipper reason details when a notable outcome has a catalog entry.
4#[derive(Debug, Clone, PartialEq, Eq, Default)]
5pub struct ZipperReasonDetails {
6    /// Numeric [`crate::proto::chain::zipper::v1::ZipperReasonCode`] wire value.
7    pub code: i32,
8    pub reason_id: String,
9    pub message: String,
10}
11
12#[derive(Debug, Clone, PartialEq, Eq, Default)]
13pub struct LifecycleFlowSummary {
14    pub intent_id: String,
15    pub flow_kind: String,
16    pub latest_step: String,
17    pub is_open: bool,
18    pub is_terminal: bool,
19    pub owner_account_id: String,
20    pub smart_account_address: String,
21    /// Product-facing reason label (`unspecified`, snake catalog labels, or
22    /// `unknown_reason_<n>` for open-enum forward compatibility).
23    pub lifecycle_reason: String,
24    pub zipper_reason: Option<ZipperReasonDetails>,
25}
26
27#[derive(Debug, Clone, PartialEq, Eq)]
28pub struct LifecycleFlowsList {
29    pub flows: Vec<LifecycleFlowSummary>,
30    pub next_page_token: String,
31}