mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
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:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user