feat(router): add delete_evidence api for disputes (#3608)

This commit is contained in:
Sai Harsha Vardhan
2024-02-12 13:47:09 +05:30
committed by GitHub
parent b6754a7de8
commit 1dc660f804
8 changed files with 151 additions and 4 deletions

View File

@ -79,7 +79,7 @@ pub struct DisputeResponsePaymentsRetrieve {
pub created_at: PrimitiveDateTime,
}
#[derive(Debug, Serialize, strum::Display, Clone)]
#[derive(Debug, Serialize, Deserialize, strum::Display, Clone)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum EvidenceType {
@ -196,3 +196,11 @@ pub struct SubmitEvidenceRequest {
/// Any additional evidence statements
pub uncategorized_text: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
pub struct DeleteEvidenceRequest {
/// Id of the dispute
pub dispute_id: String,
/// Evidence Type to be deleted
pub evidence_type: EvidenceType,
}

View File

@ -1,6 +1,8 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
use super::{DisputeResponse, DisputeResponsePaymentsRetrieve, SubmitEvidenceRequest};
use super::{
DeleteEvidenceRequest, DisputeResponse, DisputeResponsePaymentsRetrieve, SubmitEvidenceRequest,
};
impl ApiEventMetric for SubmitEvidenceRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
@ -23,3 +25,10 @@ impl ApiEventMetric for DisputeResponse {
})
}
}
impl ApiEventMetric for DeleteEvidenceRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Dispute {
dispute_id: self.dispute_id.clone(),
})
}
}