refactor(customers): add offset and limit to customers list (#5735)

This commit is contained in:
Narayan Bhat
2024-08-29 12:15:35 +05:30
committed by GitHub
parent 3f17b52a2e
commit be4419865f
10 changed files with 101 additions and 18 deletions

View File

@ -48,6 +48,16 @@ pub struct CustomerRequest {
pub metadata: Option<pii::SecretSerdeValue>,
}
#[derive(Debug, Default, Clone, Deserialize, Serialize, ToSchema)]
pub struct CustomerListRequest {
/// Offset
#[schema(example = 32)]
pub offset: Option<u32>,
/// Limit
#[schema(example = 32)]
pub limit: Option<u16>,
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
impl CustomerRequest {
pub fn get_merchant_reference_id(&self) -> Option<id_type::CustomerId> {

View File

@ -19,6 +19,7 @@ use common_utils::{
impl_api_event_type,
};
use crate::customers::CustomerListRequest;
#[allow(unused_imports)]
use crate::{
admin::*,
@ -131,7 +132,8 @@ impl_api_event_type!(
GetDisputeMetricRequest,
OrganizationResponse,
OrganizationRequest,
OrganizationId
OrganizationId,
CustomerListRequest
)
);