refactor(users): Add V2 user_roles data support (#5763)

Co-authored-by: Apoorv Dixit <apoorv.dixit@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Mani Chandra
2024-09-01 19:09:25 +05:30
committed by GitHub
parent 379831932a
commit 6b410505da
31 changed files with 768 additions and 2042 deletions

View File

@ -23,8 +23,6 @@ pub struct SignUpRequest {
pub password: Secret<String>,
}
pub type SignUpResponse = DashboardEntryResponse;
#[derive(serde::Serialize, Debug, Clone)]
pub struct DashboardEntryResponse {
pub token: Secret<String>,
@ -40,22 +38,6 @@ pub struct DashboardEntryResponse {
pub type SignInRequest = SignUpRequest;
#[derive(Debug, serde::Serialize)]
#[serde(tag = "flow_type", rename_all = "snake_case")]
pub enum SignInResponse {
MerchantSelect(MerchantSelectResponse),
DashboardEntry(DashboardEntryResponse),
}
#[derive(Debug, serde::Serialize)]
pub struct MerchantSelectResponse {
pub token: Secret<String>,
pub name: Secret<String>,
pub email: pii::Email,
pub verification_days_left: Option<i64>,
pub merchants: Vec<UserMerchantAccount>,
}
#[derive(serde::Deserialize, Debug, Clone, serde::Serialize)]
pub struct ConnectAccountRequest {
pub email: pii::Email,
@ -202,8 +184,6 @@ pub struct VerifyEmailRequest {
pub token: Secret<String>,
}
pub type VerifyEmailResponse = SignInResponse;
#[derive(serde::Deserialize, Debug, serde::Serialize)]
pub struct SendVerifyEmailRequest {
pub email: pii::Email,
@ -232,11 +212,6 @@ pub struct UpdateUserAccountDetailsRequest {
pub preferred_merchant_id: Option<id_type::MerchantId>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct TokenOnlyQueryParam {
pub token_only: Option<bool>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct SkipTwoFactorAuthQueryParam {
pub skip_two_factor_auth: Option<bool>,
@ -254,12 +229,6 @@ pub struct TwoFactorAuthStatusResponse {
pub recovery_code: bool,
}
#[derive(Debug, serde::Serialize)]
#[serde(untagged)]
pub enum TokenOrPayloadResponse<T> {
Token(TokenResponse),
Payload(T),
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct UserFromEmailRequest {
pub token: Secret<String>,