Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Research integrating the Advocate Code system #189

Open
romeboards opened this issue Mar 29, 2017 · 10 comments
Open

Research integrating the Advocate Code system #189

romeboards opened this issue Mar 29, 2017 · 10 comments
Assignees

Comments

@romeboards
Copy link
Contributor

romeboards commented Mar 29, 2017

The advocate code system allows a tenant user to be associated with an advocate user. When the tenant signs up, they'll be asked to enter the provided Advocate Code (see here for an example).

We want to append the advocate code to the provided link in the SMS content, i.e. https://www.justfix.nyc?q=samplecode

However, we can't know the length of the advocate code, which is a problem given our 160 character length of the SMS. So we'll probably want some sort of hash system or key-value mapping that would allow https:/www.justfix.nyc?q=1 where 1 => samplecode

Finally, when a user navigates to this link with the Advocate Code in the query string, we'll want to prepopulate the form with the code OR directly navigate the user to the post-code-entered state.

@romeboards romeboards added this to the Twilio Project Phase 1 milestone Mar 29, 2017
@kiranvalsia kiranvalsia self-assigned this Mar 29, 2017
@kiranvalsia
Copy link

Hey Dan,
Can you share few sample Advocate codes with me? Also, a snapshot of the Database column type(from MongoDB) that this field is mapped to?
Thanks!

@romeboards
Copy link
Contributor Author

Angular detects the query string (?q=samplecode)
Angular makes the call to validate the code
If successful, we redirect to the Code Referral Landing Page

@romeboards
Copy link
Contributor Author

@romeboards
Copy link
Contributor Author

romeboards commented Apr 21, 2017

  1. Detect queryString in public/modules/core/config/core.client.config.js (see line 43 for a different qs detection).
  2. If theres a string, redirect to /onboarding/referral
      if($location.search().q) {
        $location.path('/onboarding/referral');
      }
  1. State logic in public/modules/onboarding/config/onboarding.client.routes.js has a resolve that validates the query, then either renders the view with the advocate data or redirects to the general signup page (/signup)

Pseudocode: https://gist.github.com/romeboards/894f3d1ed55fd2444a61f19cd474f28c

@romeboards
Copy link
Contributor Author

@kiranvalsia see attached for a comp of the new advocate landing page! thanks!!

access code sms

@romeboards
Copy link
Contributor Author

Hi @kiranvalsia ! Thanks for the great work. Have you been able to test this yet by creating some sample advocate codes and tenant users?

@kiranvalsia
Copy link

Hi @romeboards . Actually, I am having trouble testing it on my local DB instance. I will send you more details tomorrow. Thanks.

@romeboards
Copy link
Contributor Author

Hi @kiranvalsia - please let me know and hopefully I can be of assistance!

@kiranvalsia
Copy link

kiranvalsia commented May 11, 2017

Hi @romeboards So far, I have mock tested the flow by passing the advocate code in the UI (?code=123 appended to the URL) and the url gets routed to the new landing page.

As for DB, i start the local MongoDB instance and when I signup, I get success message on UI(Below is the screenshot). But no records are inserted in the DB. Can you tell me what I am missing? (which DB user,tables etc) so I can create some sample advocate codes and tenant users?

Alternatively, I was thinking to import the db tables into my local Mongo instance, so I could test the validation. What do you think?

@kiranvalsia
Copy link

screen shot 2017-04-28 at 3 40 29 pm

@romeboards romeboards assigned romeboards and unassigned kiranvalsia Jun 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants