mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(refunds): Refunds aggregate api (#5795)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
use crate::refunds::{
|
||||
RefundListFilters, RefundListMetaData, RefundListRequest, RefundListResponse,
|
||||
RefundManualUpdateRequest, RefundRequest, RefundResponse, RefundUpdateRequest,
|
||||
RefundsRetrieveRequest,
|
||||
RefundAggregateResponse, RefundListFilters, RefundListMetaData, RefundListRequest,
|
||||
RefundListResponse, RefundManualUpdateRequest, RefundRequest, RefundResponse,
|
||||
RefundUpdateRequest, RefundsRetrieveRequest,
|
||||
};
|
||||
|
||||
impl ApiEventMetric for RefundRequest {
|
||||
@ -66,6 +66,12 @@ impl ApiEventMetric for RefundListResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for RefundAggregateResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::ResourceListAPI)
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for RefundListMetaData {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::ResourceListAPI)
|
||||
|
||||
@ -234,6 +234,12 @@ pub struct RefundListFilters {
|
||||
pub refund_status: Vec<enums::RefundStatus>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, ToSchema)]
|
||||
pub struct RefundAggregateResponse {
|
||||
/// The list of refund status with their count
|
||||
pub status_with_count: HashMap<enums::RefundStatus, i64>,
|
||||
}
|
||||
|
||||
/// The status for refunds
|
||||
#[derive(
|
||||
Debug,
|
||||
|
||||
Reference in New Issue
Block a user