mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	feat(framework): Diesel and domain model changes to support multiple outgoing webhooks (#9816)
This commit is contained in:
		| @ -20,6 +20,7 @@ mod relay; | ||||
| mod routing; | ||||
| mod subscription; | ||||
| mod tenant; | ||||
| mod webhook_endpoint; | ||||
|  | ||||
| use std::{borrow::Cow, fmt::Debug}; | ||||
|  | ||||
| @ -60,6 +61,7 @@ pub use self::{ | ||||
|     routing::RoutingId, | ||||
|     subscription::SubscriptionId, | ||||
|     tenant::TenantId, | ||||
|     webhook_endpoint::WebhookEndpointId, | ||||
| }; | ||||
| use crate::{fp_utils::when, generate_id_with_default_len}; | ||||
|  | ||||
|  | ||||
							
								
								
									
										24
									
								
								crates/common_utils/src/id_type/webhook_endpoint.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								crates/common_utils/src/id_type/webhook_endpoint.rs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| use crate::errors::{CustomResult, ValidationError}; | ||||
|  | ||||
| crate::id_type!( | ||||
|     WebhookEndpointId, | ||||
|     "A type for webhook_endpoint_id that can be used for unique identifier for a webhook_endpoint" | ||||
| ); | ||||
| crate::impl_id_type_methods!(WebhookEndpointId, "webhook_endpoint_id"); | ||||
| crate::impl_generate_id_id_type!(WebhookEndpointId, "whe"); | ||||
| crate::impl_default_id_type!(WebhookEndpointId, "whe"); | ||||
|  | ||||
| // This is to display the `WebhookEndpointId` as WebhookEndpointId(abcd) | ||||
| crate::impl_debug_id_type!(WebhookEndpointId); | ||||
| crate::impl_try_from_cow_str_id_type!(WebhookEndpointId, "webhook_endpoint_id"); | ||||
|  | ||||
| crate::impl_serializable_secret_id_type!(WebhookEndpointId); | ||||
| crate::impl_queryable_id_type!(WebhookEndpointId); | ||||
| crate::impl_to_sql_from_sql_id_type!(WebhookEndpointId); | ||||
|  | ||||
| impl WebhookEndpointId { | ||||
|     /// Get webhook_endpoint id from String | ||||
|     pub fn try_from_string(webhook_endpoint_id: String) -> CustomResult<Self, ValidationError> { | ||||
|         Self::try_from(std::borrow::Cow::from(webhook_endpoint_id)) | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 sweta-sharma
					sweta-sharma