mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(router): Default configs and toggle api for dynamic routing feature (#5830)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -236,6 +236,33 @@ pub async fn update_business_profile_active_algorithm_ref( | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| #[cfg(feature = "v1")] | ||||
| pub async fn update_business_profile_active_dynamic_algorithm_ref( | ||||
|     db: &dyn StorageInterface, | ||||
|     key_manager_state: &KeyManagerState, | ||||
|     merchant_key_store: &domain::MerchantKeyStore, | ||||
|     current_business_profile: domain::BusinessProfile, | ||||
|     dynamic_routing_algorithm: routing_types::DynamicRoutingAlgorithmRef, | ||||
| ) -> RouterResult<()> { | ||||
|     let ref_val = dynamic_routing_algorithm | ||||
|         .encode_to_value() | ||||
|         .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|         .attach_printable("Failed to convert dynamic routing ref to value")?; | ||||
|     let business_profile_update = domain::BusinessProfileUpdate::DynamicRoutingAlgorithmUpdate { | ||||
|         dynamic_routing_algorithm: Some(ref_val), | ||||
|     }; | ||||
|     db.update_business_profile_by_profile_id( | ||||
|         key_manager_state, | ||||
|         merchant_key_store, | ||||
|         current_business_profile, | ||||
|         business_profile_update, | ||||
|     ) | ||||
|     .await | ||||
|     .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|     .attach_printable("Failed to update dynamic routing algorithm ref in business profile")?; | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| #[cfg(feature = "v2")] | ||||
| #[derive(Clone, Debug)] | ||||
| pub struct RoutingAlgorithmHelpers<'h> { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Prajjwal Kumar
					Prajjwal Kumar