-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(platform): implement convert organization to platform organization #10910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AnkitKmrGupta
wants to merge
9
commits into
main
Choose a base branch
from
convert-org-to-platform-org
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+338
−137
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changed Files
|
tsdk02
requested changes
Jan 13, 2026
tsdk02
reviewed
Jan 14, 2026
110b8b1 to
ebc390f
Compare
tsdk02
previously approved these changes
Jan 14, 2026
| pub company_name: String, | ||
| pub product_type: Option<common_enums::MerchantProductType>, | ||
| pub merchant_account_type: Option<common_enums::MerchantAccountRequestType>, | ||
| pub merchant_account_type: Option<common_enums::MerchantAccountType>, |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be MerchantAccountRequestType?
| } | ||
|
|
||
| #[cfg(all(feature = "olap", feature = "v1"))] | ||
| fn create_platform_merchant_account_request( |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if we can move this functions to utils/helpers.
…vert-org-to-platform-org
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This pull request introduces support for Platform Organizations, enabling both:
signup_with_merchant_id.Along with these flows, the PR updates organization and merchant account creation logic, validation rules, and data models to safely enable platform-specific capabilities.
Key Changes
Platform Organization Creation & Conversion
Added new API request/response types:
ConvertOrganizationToPlatformRequestConvertOrganizationToPlatformResponseto support upgrading an existing organization to a Platform Organization, including event metric implementations.
Implemented
convert_organization_to_platform_organization, which:PlatformExtended
signup_with_merchant_idto support direct creation of a Platform Organization during signup when platform creation is enabled and allowed.Updated
OrganizationUpdateandOrganizationUpdateInternalto support theConvertToPlatformvariant, ensuring correct organization type transitions and platform merchant handling.Data Model and Enum Updates
OrganizationTypeto relevant API and database models to explicitly track whether an organization isSTANDARDorPLATFORM.MerchantAccountRequestTypewithMerchantAccountTypeacross multiple models.Merchant Account Creation and Validation
Tightened merchant creation rules:
Added helpers to safely construct platform merchant creation requests.
User Signup and Platform Safeguards
signup_with_merchant_idin production environments unless explicitly permitted.InvalidPlatformOperationerror variant for clearer error reporting on invalid platform-related actions.Miscellaneous
These changes collectively enable safe creation and upgrading of Platform Organizations while enforcing strict business rules around merchant management and platform operations.
How did you test it?
Convert To Platform
Create Organization
Convert To Platform
Signup with merchant_id
Screenshots
Convert To Platform
Signup with merchant_id
Checklist
cargo +nightly fmt --allcargo clippy