Skip to content
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

Discussion regarding the new structure for users #7550

Closed
tsdk02 opened this issue Mar 18, 2025 · 2 comments
Closed

Discussion regarding the new structure for users #7550

tsdk02 opened this issue Mar 18, 2025 · 2 comments
Assignees

Comments

@tsdk02
Copy link
Contributor

tsdk02 commented Mar 18, 2025

Formulate a method to extend the scope to all product type merchant accounts (other than currently existing orchestration)

@tsdk02 tsdk02 self-assigned this Mar 20, 2025
@tsdk02
Copy link
Contributor Author

tsdk02 commented Mar 20, 2025

With the existing v1 routes flow, the following points can be understood for inviting users to V2 merchant accounts.

Profile Level Roles:

Invite Users to V2 merchant account with profile level roles will succeed, as org_id, merchant_id, and profile_id are available for the user in the user_roles table.

  • If only invited to v2 merchant account, one entry in user_roles table, and credentials can be taken to form the jwt token
  • If already existing user, have both v1 and v2 merchant account roles, sign in still possible as credentials available in user_roles table to form the jwt token

Org Level Roles:

Invite Users to V2 merchant account with org_admin role will succeed, as org_id is available for the user in the user_roles table.

  • This will always succeed.
  • User roles table will have org_id
  • It will query merchant_account table with the org_id and get a v1 merchant account (which always will exist, the orchestrator account)
  • Sign in will happen to this v1 merchant account, and then the user can switch to the v2 merchant account.

Merchant Level Roles:

Invite Users to V2 merchant account with merchant_admin role failed.
In user_roles table, you will have the org_id and merchant_id
User roles table will have org_id and merchant_id.
There are 2 cases for this:

  • Case 1:
    • If the merchant_id is of v1 merchant account, it will query v1 business_profile table and get a profile_id and then form jwt token to sign in to v1 merchant account, and then switch to v2 merchant account
  • Case 2:
    • If the merchant_id is of v2 merchant account, it will query v1 business_profile table and will not find a profile_id associated with the merchant_id, so jwt token cannot be formed.

@tsdk02
Copy link
Contributor Author

tsdk02 commented Mar 26, 2025

The V1 and V2 schema tables for merchant_account need to be merged into a global schema, which can be accessed by both v1 and v2 deployments, to enable sign-in for the users who are invited only to v2 merchant accounts.

Sign-in routes need to be created for v2, which will be the way forward, to sign-in to v1 as well as v2 merchant accounts, as querying can be done based on id column from these accounts tables.

@tsdk02 tsdk02 closed this as completed Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant