feat(process_tracker): Add resume api to resume the tasks in process tracker for revenue_recovery (#9461)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2025-09-24 17:13:56 +05:30
committed by GitHub
parent 008728283e
commit a4b6df0844
8 changed files with 201 additions and 65 deletions

View File

@ -1,6 +1,8 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
use crate::process_tracker::revenue_recovery::{RevenueRecoveryId, RevenueRecoveryResponse};
use crate::process_tracker::revenue_recovery::{
RevenueRecoveryId, RevenueRecoveryResponse, RevenueRecoveryRetriggerRequest,
};
impl ApiEventMetric for RevenueRecoveryResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
@ -12,3 +14,8 @@ impl ApiEventMetric for RevenueRecoveryId {
Some(ApiEventsType::ProcessTracker)
}
}
impl ApiEventMetric for RevenueRecoveryRetriggerRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::ProcessTracker)
}
}

View File

@ -8,7 +8,11 @@ use crate::enums;
pub struct RevenueRecoveryResponse {
pub id: String,
pub name: Option<String>,
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub schedule_time_for_payment: Option<PrimitiveDateTime>,
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub schedule_time_for_psync: Option<PrimitiveDateTime>,
#[schema(value_type = ProcessTrackerStatus, example = "finish")]
pub status: enums::ProcessTrackerStatus,
@ -19,3 +23,17 @@ pub struct RevenueRecoveryResponse {
pub struct RevenueRecoveryId {
pub revenue_recovery_id: id_type::GlobalPaymentId,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct RevenueRecoveryRetriggerRequest {
/// The task we want to resume
pub revenue_recovery_task: String,
/// Time at which the job was scheduled at
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub schedule_time: Option<PrimitiveDateTime>,
/// Status of The Process Tracker Task
pub status: enums::ProcessTrackerStatus,
/// Business Status of The Process Tracker Task
pub business_status: String,
}