mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
fix(payments): add time range in list payment attempts query (#5959)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use std::collections::HashSet;
|
||||
|
||||
pub use common_utils::types::TimeRange;
|
||||
use common_utils::{events::ApiEventMetric, pii::EmailStrategy, types::authentication::AuthInfo};
|
||||
use masking::Secret;
|
||||
|
||||
@ -14,8 +15,6 @@ use self::{
|
||||
refunds::{RefundDimensions, RefundMetrics},
|
||||
sdk_events::{SdkEventDimensions, SdkEventMetrics},
|
||||
};
|
||||
pub use crate::payments::TimeRange;
|
||||
|
||||
pub mod active_payments;
|
||||
pub mod api_event;
|
||||
pub mod auth_events;
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
use common_utils::hashing::HashedString;
|
||||
use common_utils::{hashing::HashedString, types::TimeRange};
|
||||
use masking::WithType;
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::payments::TimeRange;
|
||||
|
||||
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
|
||||
pub struct SearchFilters {
|
||||
pub payment_method: Option<Vec<String>>,
|
||||
|
||||
@ -39,8 +39,6 @@ use crate::{
|
||||
verifications::*,
|
||||
};
|
||||
|
||||
impl ApiEventMetric for TimeRange {}
|
||||
|
||||
impl ApiEventMetric for GetPaymentIntentFiltersRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Analytics)
|
||||
|
||||
@ -4204,7 +4204,7 @@ pub struct PaymentListFilterConstraints {
|
||||
pub amount_filter: Option<AmountFilter>,
|
||||
/// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc).
|
||||
#[serde(flatten)]
|
||||
pub time_range: Option<TimeRange>,
|
||||
pub time_range: Option<common_utils::types::TimeRange>,
|
||||
/// The list of connectors to filter payments list
|
||||
pub connector: Option<Vec<api_enums::Connector>>,
|
||||
/// The list of currencies to filter payments list
|
||||
@ -4295,20 +4295,6 @@ pub enum SortBy {
|
||||
Desc,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Debug, Clone, Copy, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash, ToSchema,
|
||||
)]
|
||||
pub struct TimeRange {
|
||||
/// The start time to filter payments list or to get list of filters. To get list of filters start time is needed to be passed
|
||||
#[serde(with = "common_utils::custom_serde::iso8601")]
|
||||
#[serde(alias = "startTime")]
|
||||
pub start_time: PrimitiveDateTime,
|
||||
/// The end time to filter payments list or to get list of filters. If not passed the default time is now
|
||||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
||||
#[serde(alias = "endTime")]
|
||||
pub end_time: Option<PrimitiveDateTime>,
|
||||
}
|
||||
|
||||
#[derive(Setter, Clone, Default, Debug, PartialEq, serde::Serialize)]
|
||||
pub struct VerifyResponse {
|
||||
pub verify_id: Option<id_type::PaymentId>,
|
||||
|
||||
@ -704,7 +704,7 @@ pub struct PayoutListConstraints {
|
||||
/// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc).
|
||||
#[serde(flatten)]
|
||||
#[schema(value_type = Option<TimeRange>)]
|
||||
pub time_range: Option<payments::TimeRange>,
|
||||
pub time_range: Option<common_utils::types::TimeRange>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
|
||||
@ -732,7 +732,7 @@ pub struct PayoutListFilterConstraints {
|
||||
/// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc).
|
||||
#[serde(flatten)]
|
||||
#[schema(value_type = Option<TimeRange>)]
|
||||
pub time_range: Option<payments::TimeRange>,
|
||||
pub time_range: Option<common_utils::types::TimeRange>,
|
||||
/// The list of connectors to filter payouts list
|
||||
#[schema(value_type = Option<Vec<PayoutConnectors>>, max_length = 255, example = json!(["wise", "adyen"]))]
|
||||
pub connector: Option<Vec<api_enums::PayoutConnectors>>,
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use common_utils::pii;
|
||||
pub use common_utils::types::{ChargeRefunds, MinorUnit};
|
||||
use common_utils::{pii, types::TimeRange};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use time::PrimitiveDateTime;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use super::payments::{AmountFilter, TimeRange};
|
||||
use super::payments::AmountFilter;
|
||||
use crate::{
|
||||
admin::{self, MerchantConnectorInfo},
|
||||
enums,
|
||||
|
||||
Reference in New Issue
Block a user