feat(routing): build the gRPC interface for communicating with the external service to perform elimination routing (#6672)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Chethan Rao <70657455+Chethan-rao@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2024-12-13 10:45:08 +05:30
committed by GitHub
parent 318612c2d3
commit 2a66f4a392
9 changed files with 473 additions and 210 deletions

View File

@ -745,8 +745,8 @@ pub struct EliminationRoutingConfig {
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, ToSchema)]
pub struct EliminationAnalyserConfig {
pub bucket_size: Option<u32>,
pub bucket_ttl_in_mins: Option<f64>,
pub bucket_size: Option<u64>,
pub bucket_leak_interval_in_secs: Option<u64>,
}
impl Default for EliminationRoutingConfig {
@ -755,7 +755,7 @@ impl Default for EliminationRoutingConfig {
params: Some(vec![DynamicRoutingConfigParams::PaymentMethod]),
elimination_analyser_config: Some(EliminationAnalyserConfig {
bucket_size: Some(5),
bucket_ttl_in_mins: Some(2.0),
bucket_leak_interval_in_secs: Some(2),
}),
}
}
@ -859,3 +859,18 @@ impl CurrentBlockThreshold {
}
}
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
pub struct RoutableConnectorChoiceWithBucketName {
pub routable_connector_choice: RoutableConnectorChoice,
pub bucket_name: String,
}
impl RoutableConnectorChoiceWithBucketName {
pub fn new(routable_connector_choice: RoutableConnectorChoice, bucket_name: String) -> Self {
Self {
routable_connector_choice,
bucket_name,
}
}
}