feat(core): Add support for process tracker retrieve api in v2 (#7602)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2025-03-27 16:52:03 +05:30
committed by GitHub
parent 56412bf188
commit 87140bfccc
33 changed files with 430 additions and 111 deletions

View File

@ -121,6 +121,7 @@ pub enum ApiEventsType {
PaymentMethodSession {
payment_method_session_id: id_type::GlobalPaymentMethodSessionId,
},
ProcessTracker,
}
impl ApiEventMetric for serde_json::Value {}

View File

@ -1,3 +1,4 @@
use common_enums::enums;
use error_stack::ResultExt;
use crate::{errors, generate_id_with_default_len, generate_time_ordered_id_without_prefix, types};
@ -31,6 +32,15 @@ impl GlobalPaymentId {
pub fn generate_client_secret(&self) -> types::ClientSecret {
types::ClientSecret::new(self.clone(), generate_time_ordered_id_without_prefix())
}
/// Generate the id for revenue recovery Execute PT workflow
pub fn get_execute_revenue_recovery_id(
&self,
task: &str,
runner: enums::ProcessTrackerRunner,
) -> String {
format!("{task}_{runner}_{}", self.get_string_repr())
}
}
// TODO: refactor the macro to include this id use case as well
@ -67,6 +77,15 @@ impl GlobalAttemptId {
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
/// Generate the id for Revenue Recovery Psync PT workflow
pub fn get_psync_revenue_recovery_id(
&self,
task: &str,
runner: enums::ProcessTrackerRunner,
) -> String {
format!("{runner}_{task}_{}", self.get_string_repr())
}
}
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalAttemptId {