mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
feat(constraint_graph): add visualization functionality to the constraint graph (#4701)
This commit is contained in:
@ -22,6 +22,12 @@ pub mod euclid_graph_prelude {
|
||||
|
||||
impl cgraph::KeyNode for dir::DirKey {}
|
||||
|
||||
impl cgraph::NodeViz for dir::DirKey {
|
||||
fn viz(&self) -> String {
|
||||
self.kind.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl cgraph::ValueNode for dir::DirValue {
|
||||
type Key = dir::DirKey;
|
||||
|
||||
@ -30,6 +36,41 @@ impl cgraph::ValueNode for dir::DirValue {
|
||||
}
|
||||
}
|
||||
|
||||
impl cgraph::NodeViz for dir::DirValue {
|
||||
fn viz(&self) -> String {
|
||||
match self {
|
||||
Self::PaymentMethod(pm) => pm.to_string(),
|
||||
Self::CardBin(bin) => bin.value.clone(),
|
||||
Self::CardType(ct) => ct.to_string(),
|
||||
Self::CardNetwork(cn) => cn.to_string(),
|
||||
Self::PayLaterType(plt) => plt.to_string(),
|
||||
Self::WalletType(wt) => wt.to_string(),
|
||||
Self::UpiType(ut) => ut.to_string(),
|
||||
Self::BankTransferType(btt) => btt.to_string(),
|
||||
Self::BankRedirectType(brt) => brt.to_string(),
|
||||
Self::BankDebitType(bdt) => bdt.to_string(),
|
||||
Self::CryptoType(ct) => ct.to_string(),
|
||||
Self::RewardType(rt) => rt.to_string(),
|
||||
Self::PaymentAmount(amt) => amt.number.to_string(),
|
||||
Self::PaymentCurrency(curr) => curr.to_string(),
|
||||
Self::AuthenticationType(at) => at.to_string(),
|
||||
Self::CaptureMethod(cm) => cm.to_string(),
|
||||
Self::BusinessCountry(bc) => bc.to_string(),
|
||||
Self::BillingCountry(bc) => bc.to_string(),
|
||||
Self::Connector(conn) => conn.connector.to_string(),
|
||||
Self::MetaData(mv) => format!("[{} = {}]", mv.key, mv.value),
|
||||
Self::MandateAcceptanceType(mat) => mat.to_string(),
|
||||
Self::MandateType(mt) => mt.to_string(),
|
||||
Self::PaymentType(pt) => pt.to_string(),
|
||||
Self::VoucherType(vt) => vt.to_string(),
|
||||
Self::GiftCardType(gct) => gct.to_string(),
|
||||
Self::BusinessLabel(bl) => bl.value.to_string(),
|
||||
Self::SetupFutureUsage(sfu) => sfu.to_string(),
|
||||
Self::CardRedirectType(crt) => crt.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
#[serde(tag = "type", content = "details", rename_all = "snake_case")]
|
||||
pub enum AnalysisError<V: cgraph::ValueNode> {
|
||||
|
||||
@ -289,7 +289,6 @@ pub enum DirKeyKind {
|
||||
#[serde(rename = "billing_country")]
|
||||
BillingCountry,
|
||||
#[serde(skip_deserializing, rename = "connector")]
|
||||
#[strum(disabled)]
|
||||
Connector,
|
||||
#[strum(
|
||||
serialize = "business_label",
|
||||
|
||||
Reference in New Issue
Block a user