Discussion regarding the new structure for users
Formulate a method to extend the scope to all product type merchant accounts (other than currently existing orchestration)
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_idand 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_idis of v1 merchant account, it will query v1 business_profile table and get aprofile_idand then form jwt token to sign in to v1 merchant account, and then switch to v2 merchant account
- If the
- Case 2:
- If the
merchant_idis of v2 merchant account, it will query v1 business_profile table and will not find aprofile_idassociated with themerchant_id, so jwt token cannot be formed.
- If the
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.