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

Support new user creation from SMS #35

Open
lizzyaustad opened this issue Oct 2, 2019 · 0 comments
Open

Support new user creation from SMS #35

lizzyaustad opened this issue Oct 2, 2019 · 0 comments

Comments

@lizzyaustad
Copy link
Member

# TODO: support 'new' command for new members

If the request comes from SMS, then the format of data would look like this:

    {'linkId': 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx', 
    'text': 'NEW MEMBER first_name=example last_name=user phone=12345 [email protected] role=member coop=Co-Op 1', 
    'to': '<short code>', 
    'id': 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx', 
    'date': '2019-10-02 15:12:34', 
    'from': '+11234567890}

We will need to convert the information in the text key to look like this (including converting from role and co-op name to their respective ids):

   {'first_name': 'Example', 
    'last_name': 'User', 
    'phone': '12345', 
    'email': '[email protected]', 
    'role_id': '2', 
    'co_op_id': '2'}

Once the data is converted, the create_new_user method can be called to add the user to the database. If the user is added successfully, a text message should be sent back to the from user with the message:

Member has been created. To create a revolving fund for this user, text "NEW FUND user=[] balance=[balance] interest=[interest] start=[start date] end=[end date]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant