feat(framework): Diesel and domain model changes to support multiple outgoing webhooks (#9816)

This commit is contained in:
sweta-sharma
2025-10-16 15:12:46 +05:30
committed by GitHub
parent 6f045d84f1
commit ac8c6c966c
6 changed files with 61 additions and 0 deletions

View File

@ -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};

View 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))
}
}