mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat: add a domain type for customer_id (#4705)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use cards::CardNumber;
|
||||
use common_utils::{
|
||||
consts::default_payouts_list_limit,
|
||||
crypto,
|
||||
crypto, id_type,
|
||||
pii::{self, Email},
|
||||
};
|
||||
use masking::Secret;
|
||||
@ -86,8 +86,8 @@ pub struct PayoutCreateRequest {
|
||||
pub billing: Option<payments::Address>,
|
||||
|
||||
/// The identifier for the customer object. If not provided the customer ID will be autogenerated.
|
||||
#[schema(value_type = String, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: Option<String>,
|
||||
#[schema(value_type = Option<String>, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: Option<id_type::CustomerId>,
|
||||
|
||||
/// Set to true to confirm the payout without review, no further action required
|
||||
#[schema(value_type = bool, example = true, default = false)]
|
||||
@ -314,7 +314,7 @@ pub struct Venmo {
|
||||
pub telephone_number: Option<Secret<String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, ToSchema, Clone, Serialize)]
|
||||
#[derive(Debug, ToSchema, Clone, Serialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PayoutCreateResponse {
|
||||
/// Unique identifier for the payout. This ensures idempotency for multiple payouts
|
||||
@ -367,7 +367,7 @@ pub struct PayoutCreateResponse {
|
||||
|
||||
/// The identifier for the customer object. If not provided the customer ID will be autogenerated.
|
||||
#[schema(value_type = String, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: String,
|
||||
pub customer_id: id_type::CustomerId,
|
||||
|
||||
/// Set to true to confirm the payout without review, no further action required
|
||||
#[schema(value_type = bool, example = true, default = false)]
|
||||
@ -564,8 +564,8 @@ pub struct PayoutIndividualDetails {
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PayoutListConstraints {
|
||||
/// The identifier for customer
|
||||
#[schema(example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: Option<String>,
|
||||
#[schema(value_type = Option<String>, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: Option<id_type::CustomerId>,
|
||||
|
||||
/// A cursor for use in pagination, fetch the next list after some object
|
||||
#[schema(example = "pay_fafa124123")]
|
||||
@ -605,8 +605,8 @@ pub struct PayoutListFilterConstraints {
|
||||
/// The identifier for business profile
|
||||
pub profile_id: Option<String>,
|
||||
/// The identifier for customer
|
||||
#[schema(example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: Option<String>,
|
||||
#[schema(value_type = Option<String>,example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
|
||||
pub customer_id: Option<id_type::CustomerId>,
|
||||
/// The limit on the number of objects. The default limit is 10 and max limit is 20
|
||||
#[serde(default = "default_payouts_list_limit")]
|
||||
pub limit: u32,
|
||||
|
||||
Reference in New Issue
Block a user