sphinx-tribes
sphinx-tribes copied to clipboard
referrals: `referred_by` column
Context
referral program for hunters
Design
This is a frontend and backend task.
In the frontend, if you visit the page and a url query exists with value of p
(like ?p=123456
), then save it as referred_by
in localStorage ONLY if a referred_by
value already doesn't exist in localStorage.
On signup, if referred_by
UUID exists in localStorage, then send it to the backend, find that person's ID, and store it on the newly created Person record as a new SQL column called referred_by