refactor: Improve readability and maintainability of Unified Connector Service–related code (#9820)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amitsingh Tanwar
2025-10-16 17:30:56 +05:30
committed by GitHub
parent b4eceae3a7
commit 8044aa1c48
6 changed files with 753 additions and 661 deletions

View File

@ -2301,9 +2301,87 @@ pub enum GatewaySystem {
#[default]
Direct,
UnifiedConnectorService,
}
#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
PartialOrd,
Ord,
Hash,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::VariantNames,
strum::EnumIter,
strum::EnumString,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "text")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
/// Indicates the execution path through which the payment is processed.
pub enum ExecutionPath {
#[default]
Direct,
UnifiedConnectorService,
ShadowUnifiedConnectorService,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialOrd,
Ord,
Hash,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::VariantNames,
strum::EnumIter,
strum::EnumString,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "text")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum ShadowRolloutAvailability {
IsAvailable,
NotAvailable,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialOrd,
Ord,
Hash,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::VariantNames,
strum::EnumIter,
strum::EnumString,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "text")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum UcsAvailability {
Enabled,
Disabled,
}
#[derive(
Clone,
Copy,
@ -2330,6 +2408,31 @@ pub enum ExecutionMode {
Shadow,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialOrd,
Ord,
Hash,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::VariantNames,
strum::EnumIter,
strum::EnumString,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "text")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum ConnectorIntegrationType {
UcsConnector,
DirectConnector,
}
/// The type of the payment that differentiates between normal and various types of mandate payments. Use 'setup_mandate' in case of zero auth flow.
#[derive(
Clone,