mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(user): add email apis and new enums for metadata (#3053)
Co-authored-by: Rachit Naithani <rachit.naithani@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Rachit Naithani <81706961+racnan@users.noreply.github.com>
This commit is contained in:
		| @ -7,7 +7,8 @@ use crate::user::{ | ||||
|         GetMetaDataRequest, GetMetaDataResponse, GetMultipleMetaDataPayload, SetMetaDataRequest, | ||||
|     }, | ||||
|     AuthorizeResponse, ChangePasswordRequest, ConnectAccountRequest, CreateInternalUserRequest, | ||||
|     DashboardEntryResponse, GetUsersResponse, SignUpRequest, SignUpWithMerchantIdRequest, | ||||
|     DashboardEntryResponse, ForgotPasswordRequest, GetUsersResponse, InviteUserRequest, | ||||
|     InviteUserResponse, ResetPasswordRequest, SignUpRequest, SignUpWithMerchantIdRequest, | ||||
|     SwitchMerchantIdRequest, UserMerchantCreate, | ||||
| }; | ||||
|  | ||||
| @ -33,7 +34,11 @@ common_utils::impl_misc_api_event_type!( | ||||
|     UserMerchantCreate, | ||||
|     GetUsersResponse, | ||||
|     AuthorizeResponse, | ||||
|     ConnectAccountRequest | ||||
|     ConnectAccountRequest, | ||||
|     ForgotPasswordRequest, | ||||
|     ResetPasswordRequest, | ||||
|     InviteUserRequest, | ||||
|     InviteUserResponse | ||||
| ); | ||||
|  | ||||
| #[cfg(feature = "dummy_connector")] | ||||
|  | ||||
| @ -174,7 +174,7 @@ pub struct RefundListMetaData { | ||||
|     pub currency: Vec<enums::Currency>, | ||||
|     /// The list of available refund status filters | ||||
|     #[schema(value_type = Vec<RefundStatus>)] | ||||
|     pub status: Vec<enums::RefundStatus>, | ||||
|     pub refund_status: Vec<enums::RefundStatus>, | ||||
| } | ||||
|  | ||||
| /// The status for refunds | ||||
|  | ||||
| @ -65,6 +65,29 @@ pub struct ChangePasswordRequest { | ||||
|     pub old_password: Secret<String>, | ||||
| } | ||||
|  | ||||
| #[derive(serde::Deserialize, Debug, serde::Serialize)] | ||||
| pub struct ForgotPasswordRequest { | ||||
|     pub email: pii::Email, | ||||
| } | ||||
|  | ||||
| #[derive(serde::Deserialize, Debug, serde::Serialize)] | ||||
| pub struct ResetPasswordRequest { | ||||
|     pub token: Secret<String>, | ||||
|     pub password: Secret<String>, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] | ||||
| pub struct InviteUserRequest { | ||||
|     pub email: pii::Email, | ||||
|     pub name: Secret<String>, | ||||
|     pub role_id: String, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, serde::Serialize)] | ||||
| pub struct InviteUserResponse { | ||||
|     pub is_email_sent: bool, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize)] | ||||
| pub struct SwitchMerchantIdRequest { | ||||
|     pub merchant_id: String, | ||||
|  | ||||
| @ -1,3 +1,5 @@ | ||||
| use common_enums::CountryAlpha2; | ||||
| use common_utils::pii; | ||||
| use masking::Secret; | ||||
| use strum::EnumString; | ||||
|  | ||||
| @ -12,8 +14,11 @@ pub enum SetMetaDataRequest { | ||||
|     ConfiguredRouting(ConfiguredRouting), | ||||
|     TestPayment(TestPayment), | ||||
|     IntegrationMethod(IntegrationMethod), | ||||
|     ConfigurationType(ConfigurationType), | ||||
|     IntegrationCompleted, | ||||
|     SPRoutingConfigured(ConfiguredRouting), | ||||
|     Feedback(Feedback), | ||||
|     ProdIntent(ProdIntent), | ||||
|     SPTestPayment, | ||||
|     DownloadWoocom, | ||||
|     ConfigureWoocom, | ||||
| @ -49,10 +54,38 @@ pub struct TestPayment { | ||||
|     pub payment_id: String, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize)] | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] | ||||
| pub struct IntegrationMethod { | ||||
|     pub integration_type: String, | ||||
| } | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] | ||||
| pub enum ConfigurationType { | ||||
|     Single, | ||||
|     Multiple, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] | ||||
| pub struct Feedback { | ||||
|     pub email: pii::Email, | ||||
|     pub description: Option<String>, | ||||
|     pub rating: Option<i32>, | ||||
|     pub category: Option<String>, | ||||
| } | ||||
| #[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] | ||||
| pub struct ProdIntent { | ||||
|     pub legal_business_name: Option<String>, | ||||
|     pub business_label: Option<String>, | ||||
|     pub business_location: Option<CountryAlpha2>, | ||||
|     pub display_name: Option<String>, | ||||
|     pub poc_email: Option<String>, | ||||
|     pub business_type: Option<String>, | ||||
|     pub business_identifier: Option<String>, | ||||
|     pub business_website: Option<String>, | ||||
|     pub poc_name: Option<String>, | ||||
|     pub poc_contact: Option<String>, | ||||
|     pub comments: Option<String>, | ||||
|     pub is_completed: bool, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, serde::Deserialize, EnumString, serde::Serialize)] | ||||
| pub enum GetMetaDataRequest { | ||||
| @ -65,10 +98,13 @@ pub enum GetMetaDataRequest { | ||||
|     ConfiguredRouting, | ||||
|     TestPayment, | ||||
|     IntegrationMethod, | ||||
|     ConfigurationType, | ||||
|     IntegrationCompleted, | ||||
|     StripeConnected, | ||||
|     PaypalConnected, | ||||
|     SPRoutingConfigured, | ||||
|     Feedback, | ||||
|     ProdIntent, | ||||
|     SPTestPayment, | ||||
|     DownloadWoocom, | ||||
|     ConfigureWoocom, | ||||
| @ -98,10 +134,13 @@ pub enum GetMetaDataResponse { | ||||
|     ConfiguredRouting(Option<ConfiguredRouting>), | ||||
|     TestPayment(Option<TestPayment>), | ||||
|     IntegrationMethod(Option<IntegrationMethod>), | ||||
|     ConfigurationType(Option<ConfigurationType>), | ||||
|     IntegrationCompleted(bool), | ||||
|     StripeConnected(Option<ProcessorConnected>), | ||||
|     PaypalConnected(Option<ProcessorConnected>), | ||||
|     SPRoutingConfigured(Option<ConfiguredRouting>), | ||||
|     Feedback(Option<Feedback>), | ||||
|     ProdIntent(Option<ProdIntent>), | ||||
|     SPTestPayment(bool), | ||||
|     DownloadWoocom(bool), | ||||
|     ConfigureWoocom(bool), | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Apoorv Dixit
					Apoorv Dixit