feat(global_search): add payouts configuration and update related structures in OpenSearch (#10081)

This commit is contained in:
Venu Madhav Bandarupalli
2025-11-10 12:39:35 +05:30
committed by GitHub
parent 751816810b
commit 5fb8b46d04
8 changed files with 18 additions and 2 deletions

View File

@@ -1158,6 +1158,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"

View File

@@ -266,6 +266,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"

View File

@@ -1296,6 +1296,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"

View File

@@ -1151,6 +1151,7 @@ payment_attempts = "hyperswitch-payment-attempt-events"
payment_intents = "hyperswitch-payment-intent-events"
refunds = "hyperswitch-refund-events"
disputes = "hyperswitch-dispute-events"
payouts = "hyperswitch-payout-events"
sessionizer_payment_attempts = "sessionizer-payment-attempt-events"
sessionizer_payment_intents = "sessionizer-payment-intent-events"
sessionizer_refunds = "sessionizer-refund-events"

View File

@@ -16,6 +16,7 @@ sources:
- hyperswitch-payment-intent-events
- hyperswitch-refund-events
- hyperswitch-dispute-events
- hyperswitch-payout-events
decoding:
codec: json

View File

@@ -43,6 +43,7 @@ pub struct OpenSearchIndexes {
pub payment_intents: String,
pub refunds: String,
pub disputes: String,
pub payouts: String,
pub sessionizer_payment_attempts: String,
pub sessionizer_payment_intents: String,
pub sessionizer_refunds: String,
@@ -88,6 +89,7 @@ impl Default for OpenSearchConfig {
payment_intents: "hyperswitch-payment-intent-events".to_string(),
refunds: "hyperswitch-refund-events".to_string(),
disputes: "hyperswitch-dispute-events".to_string(),
payouts: "hyperswitch-payout-events".to_string(),
sessionizer_payment_attempts: "sessionizer-payment-attempt-events".to_string(),
sessionizer_payment_intents: "sessionizer-payment-intent-events".to_string(),
sessionizer_refunds: "sessionizer-refund-events".to_string(),
@@ -239,6 +241,7 @@ impl OpenSearchClient {
SearchIndex::PaymentIntents => self.indexes.payment_intents.clone(),
SearchIndex::Refunds => self.indexes.refunds.clone(),
SearchIndex::Disputes => self.indexes.disputes.clone(),
SearchIndex::Payouts => self.indexes.payouts.clone(),
SearchIndex::SessionizerPaymentAttempts => {
self.indexes.sessionizer_payment_attempts.clone()
}
@@ -352,6 +355,12 @@ impl OpenSearchIndexes {
))
})?;
when(self.payouts.is_default_or_empty(), || {
Err(ApplicationError::InvalidConfigurationValueError(
"Opensearch Payouts index must not be empty".into(),
))
})?;
when(
self.sessionizer_payment_attempts.is_default_or_empty(),
|| {

View File

@@ -72,6 +72,7 @@ pub enum SearchIndex {
PaymentIntents,
Refunds,
Disputes,
Payouts,
SessionizerPaymentAttempts,
SessionizerPaymentIntents,
SessionizerRefunds,

View File

@@ -1,11 +1,12 @@
use api_models::analytics::search::SearchIndex;
pub const fn get_search_indexes() -> [SearchIndex; 8] {
pub const fn get_search_indexes() -> [SearchIndex; 9] {
[
SearchIndex::PaymentAttempts,
SearchIndex::PaymentIntents,
SearchIndex::Refunds,
SearchIndex::Disputes,
SearchIndex::Payouts,
SearchIndex::SessionizerPaymentAttempts,
SearchIndex::SessionizerPaymentIntents,
SearchIndex::SessionizerRefunds,
@@ -13,4 +14,4 @@ pub const fn get_search_indexes() -> [SearchIndex; 8] {
]
}
pub const SEARCH_INDEXES: [SearchIndex; 8] = get_search_indexes();
pub const SEARCH_INDEXES: [SearchIndex; 9] = get_search_indexes();