feat(core): create a process_tracker workflow for PCR (#7124)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2025-02-27 18:29:06 +05:30
committed by GitHub
parent c3b7197304
commit 44dc45b8bd
23 changed files with 855 additions and 32 deletions

View File

@ -350,6 +350,25 @@ pub fn get_outgoing_webhook_retry_schedule_time(
}
}
pub fn get_pcr_payments_retry_schedule_time(
mapping: process_data::RevenueRecoveryPaymentProcessTrackerMapping,
merchant_id: &common_utils::id_type::MerchantId,
retry_count: i32,
) -> Option<i32> {
let mapping = match mapping.custom_merchant_mapping.get(merchant_id) {
Some(map) => map.clone(),
None => mapping.default_mapping,
};
// TODO: check if the current scheduled time is not more than the configured timerange
// For first try, get the `start_after` time
if retry_count == 0 {
Some(mapping.start_after)
} else {
get_delay(retry_count, &mapping.frequencies)
}
}
/// Get the delay based on the retry count
pub fn get_delay<'a>(
retry_count: i32,