feat(webhook): add filter by event class and type (#7275)

Co-authored-by: Aishwariyaa Anand <aishwariyaa.anand@Aishwariyaa-Anand-C3PGW02T6Y.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Aishwariyaa Anand
2025-04-11 15:45:23 +05:30
committed by GitHub
parent e677b1389f
commit 989b2c34e1
12 changed files with 346 additions and 219 deletions

View File

@ -1,3 +1,5 @@
use std::collections::HashSet;
use common_enums::{EventClass, EventType, WebhookDeliveryAttempt};
use masking::Secret;
use serde::{Deserialize, Serialize};
@ -29,6 +31,11 @@ pub struct EventListConstraints {
#[schema(value_type = Option<String>)]
pub profile_id: Option<common_utils::id_type::ProfileId>,
/// Filter events by their class.
pub event_classes: Option<HashSet<EventClass>>,
/// Filter events by their type.
pub event_types: Option<HashSet<EventType>>,
/// Filter all events by `is_overall_delivery_successful` field of the event.
pub is_delivered: Option<bool>,
}
@ -40,6 +47,8 @@ pub enum EventListConstraintsInternal {
created_before: Option<PrimitiveDateTime>,
limit: Option<i64>,
offset: Option<i64>,
event_classes: Option<HashSet<EventClass>>,
event_types: Option<HashSet<EventType>>,
is_delivered: Option<bool>,
},
ObjectIdFilter {