-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(wallet/backend): add script for managed user and customer creation #1675
Conversation
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.
Based on a discussion with Bogdan:
- when we create the managed user we want to add the payment pointer in the
meta
object.- if the user signs up and verifies the email, we can automatically create the payment pointer on our side with the correct value (i.e: 059)
waiting for response ^we can pass themeta
object when creating the managed user
- whitelisting: whenever someone tries to sign up, we fetch all managed users and we check if the email exists
- if the user exists, we can retrieve the payment pointer from the
meta
object and create the payment pointer - if the user doesn't exist: TBD
- if the user exists, we can retrieve the payment pointer from the
- Update ENV variables (DEV & PROD) - Fix API endpoints - Update types
packages/wallet/backend/migrations/20241008143459_add_customer_id_to_users.js
Show resolved
Hide resolved
meta: Record<string, string> | ||
): Promise<void> { | ||
const url = `${this.apiUrl}/auth/v1/users/managed` | ||
const body = { meta } |
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.
This was the reason for the faulty meta
object.
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.
Added a comment and updated the types for the meta
object here: 930e750.
0599b2a
to
930e750
Compare
ppNumber: string | ||
} | ||
|
||
const entries = `John;Doe;john@doe.com:8888 |
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.
is this for example porposes? can the list be read from an external file?
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.
This is how the entries should be added. It can be updated to read from an external file as well, but for simplicity reason we decided to just put the CSV contents directly in the variable.
) | ||
|
||
const user = await gateHubClient.getWalletForUser(managedUser.id) | ||
const walletAddress = user.wallets[0].address |
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.
should we use the default wallet created instead of creating on for each account?
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.
getWalletForUser
retrieves the already created wallet - when the managed user is created. We are not creating another wallet here.
Latest changes look good @raducristianpopa, thank you! However, I think we can already rename |
Oh, yes! A lot better than keeping the card prefix there. |
Context
Changes
This PR adds the script for managed user and customer creation as well as the updated types and card ordering logic.