feat(events): add hashed customer_email and feature_metadata (#5220)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sandeep Kumar
2024-07-05 20:36:59 +05:30
committed by GitHub
parent 5ebfbaf199
commit ae2a34e02c
13 changed files with 105 additions and 13 deletions

View File

@ -51,7 +51,18 @@ pub async fn msearch_results(
if let Some(customer_email) = filters.customer_email {
if !customer_email.is_empty() {
query_builder
.add_filter_clause("customer_email.keyword".to_string(), customer_email.clone())
.add_filter_clause(
"customer_email.keyword".to_string(),
customer_email
.iter()
.filter_map(|email| {
// TODO: Add trait based inputs instead of converting this to strings
serde_json::to_value(email)
.ok()
.and_then(|a| a.as_str().map(|a| a.to_string()))
})
.collect(),
)
.switch()?;
}
};
@ -147,7 +158,18 @@ pub async fn search_results(
if let Some(customer_email) = filters.customer_email {
if !customer_email.is_empty() {
query_builder
.add_filter_clause("customer_email.keyword".to_string(), customer_email.clone())
.add_filter_clause(
"customer_email.keyword".to_string(),
customer_email
.iter()
.filter_map(|email| {
// TODO: Add trait based inputs instead of converting this to strings
serde_json::to_value(email)
.ok()
.and_then(|a| a.as_str().map(|a| a.to_string()))
})
.collect(),
)
.switch()?;
}
};