feat(vsaas): integrate onboarding flow for vertical saas (#7884)

This commit is contained in:
Apoorv Dixit
2025-05-12 19:19:42 +05:30
committed by GitHub
parent 57cb3a9ff0
commit cf34be1728
22 changed files with 376 additions and 33 deletions

View File

@ -15,13 +15,13 @@ use crate::user::{
CreateTenantUserRequest, CreateUserAuthenticationMethodRequest, ForgotPasswordRequest,
GetSsoAuthUrlRequest, GetUserAuthenticationMethodsRequest, GetUserDetailsResponse,
GetUserRoleDetailsRequest, GetUserRoleDetailsResponseV2, InviteUserRequest,
ReInviteUserRequest, RecoveryCodes, ResetPasswordRequest, RotatePasswordRequest,
SendVerifyEmailRequest, SignUpRequest, SignUpWithMerchantIdRequest, SsoSignInRequest,
SwitchMerchantRequest, SwitchOrganizationRequest, SwitchProfileRequest, TokenResponse,
TwoFactorAuthStatusResponse, TwoFactorStatus, UpdateUserAccountDetailsRequest,
UpdateUserAuthenticationMethodRequest, UserFromEmailRequest, UserMerchantAccountResponse,
UserMerchantCreate, UserOrgMerchantCreateRequest, VerifyEmailRequest,
VerifyRecoveryCodeRequest, VerifyTotpRequest,
PlatformAccountCreateRequest, PlatformAccountCreateResponse, ReInviteUserRequest,
RecoveryCodes, ResetPasswordRequest, RotatePasswordRequest, SendVerifyEmailRequest,
SignUpRequest, SignUpWithMerchantIdRequest, SsoSignInRequest, SwitchMerchantRequest,
SwitchOrganizationRequest, SwitchProfileRequest, TokenResponse, TwoFactorAuthStatusResponse,
TwoFactorStatus, UpdateUserAccountDetailsRequest, UpdateUserAuthenticationMethodRequest,
UserFromEmailRequest, UserMerchantAccountResponse, UserMerchantCreate,
UserOrgMerchantCreateRequest, VerifyEmailRequest, VerifyRecoveryCodeRequest, VerifyTotpRequest,
};
common_utils::impl_api_event_type!(
@ -39,6 +39,8 @@ common_utils::impl_api_event_type!(
SwitchProfileRequest,
CreateInternalUserRequest,
CreateTenantUserRequest,
PlatformAccountCreateRequest,
PlatformAccountCreateResponse,
UserOrgMerchantCreateRequest,
UserMerchantAccountResponse,
UserMerchantCreate,

View File

@ -1,14 +1,17 @@
use common_enums::OrganizationType;
use common_utils::{id_type, pii};
use utoipa::ToSchema;
pub struct OrganizationNew {
pub org_id: id_type::OrganizationId,
pub org_type: OrganizationType,
pub org_name: Option<String>,
}
impl OrganizationNew {
pub fn new(org_name: Option<String>) -> Self {
pub fn new(org_type: OrganizationType, org_name: Option<String>) -> Self {
Self {
org_id: id_type::OrganizationId::default(),
org_type,
org_name,
}
}
@ -47,6 +50,9 @@ pub struct OrganizationUpdateRequest {
/// Metadata is useful for storing additional, unstructured information on an object.
#[schema(value_type = Option<Object>)]
pub metadata: Option<pii::SecretSerdeValue>,
/// Platform merchant id is unique distiguisher for special merchant in the platform org
pub platform_merchant_id: Option<id_type::MerchantId>,
}
#[cfg(feature = "v1")]
#[derive(Debug, serde::Serialize, Clone, ToSchema)]

View File

@ -130,6 +130,20 @@ pub struct UserOrgMerchantCreateRequest {
pub merchant_name: Secret<String>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct PlatformAccountCreateRequest {
pub organization_name: Secret<String>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct PlatformAccountCreateResponse {
pub org_id: id_type::OrganizationId,
pub org_name: Option<String>,
pub org_type: common_enums::OrganizationType,
pub merchant_id: id_type::MerchantId,
pub merchant_account_type: common_enums::MerchantAccountType,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct UserMerchantCreate {
pub company_name: String,
@ -381,6 +395,7 @@ pub struct UserTransferKeyResponse {
pub struct ListOrgsForUserResponse {
pub org_id: id_type::OrganizationId,
pub org_name: Option<String>,
pub org_type: common_enums::OrganizationType,
}
#[derive(Debug, serde::Serialize)]
@ -388,6 +403,7 @@ pub struct UserMerchantAccountResponse {
pub merchant_id: id_type::MerchantId,
pub merchant_name: OptionalEncryptableName,
pub product_type: Option<common_enums::MerchantProductType>,
pub merchant_account_type: common_enums::MerchantAccountType,
pub version: common_enums::ApiVersion,
}