voteamerica / backend Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
This is the case for all ride management links in emails. Please change the text to the following:
We have let [rider name] know that you have accepted their request for a ride. [Rider name] is now waiting for you to get in touch to arrange the details of the ride.
Please contact the rider as soon as possible via [preferred contact method].
We have sent your an email [and SMS, if applicable] notification confirming this information. If you do not receive this, please contact customer support: 804-239-3389
We have let [Drive Name] know that you no longer need a ride from them. Our system will keep trying to find you a match.
Carpool Vote cannot guarantee that there will be another match, or that another driver will provide a ride as agreed. Please keep looking for a ride until you have reached your destination.
If this was an error, please contact user support on 804-239-3389.
Your request for a ride has been cancelled. If you had already been matched with a driver, we've let the driver know that you no longer need a ride.
You can reactivate the request through the self-service portal [please include link to specific UUID login] or by calling 804-239-3389. You can also sign up again on CarpoolVote.com.
Thank you for offering to help! This rider no longer needs a ride. We'll let you if anything changes.
We have sent [Rider Name] a notification that you are no longer able to offer them a ride. If their preferred contact method was phone, we ask that you also let them know in this way, as our system does not currently support voice notifications.
Our system will keep trying to find the rider another match.
If you cancelled the ride offer in error, please contact rider to let them know.
This should only become visible once match has been accepted.
Please:
Also separate SMS and notes into 2 separate lines (currently they appear next to each other, and look squashed/confusing)
Should log client's IP Address, rather than some form field. (So that we know where it came in form).
http://stackoverflow.com/questions/19266329/node-js-get-clients-ip
@jkbits1 See new USER STORY 016
I'll have the procedure ready soon.
And I need to update a few e-mail notifications to include the new link
I imagine this would result in some unintended actions (I thought we'd removed these?)
Please could we remove the cancellation link from both ride request and drive offer notification text messages?
Please add rider contact details to SMS notification that the driver receives after confirming a match. We do not want to risk them forgetting to get in touch with the rider.
Please also do the same the other way around. I.e., send the rider the driver's contact details (in case there's an issue with the driver getting in touch).
For Example:
rider row insert failed: null value in column "TwoWayTripNeeded" violates not-null constraint.
What should happen:
The backend node app should check for existence / provide default (false/0) values for the data elements which are being inserted.
Those include:
DrivingOnBehalfOfOrganization (default false)
WheelchairCount (default 0)
NonWheelchairCount (default 0)
TwoWayTripNeeded (default false)
DriverEmailValidated (default 0/false?, until validated by confirming/responding to Email.)
DriverPhoneValidated (default 0/false, until validated by confirming/responding to Text.)
ReadyToMatch (default 0)
PleaseStayInTouch (default 0)
see voteamerica/voteamerica.github.io#257 for details
This way, the driver won't be disturbed by notifications but can still log into the self-service portal if they like. This also means that existing ride offers won't be canceled (these should be canceled individually).
In the self-service portal, please also remove "Cancel drive offer" link.
In the self-service portal, add a link that allows drivers to reactivate notifications.
Current algorithm proposed matches up to 100 miles away from the driver zip code, even outside of radius (but with a reduced score).
Based on user feedback, 100 miles seems to far away (indeed....)
The 100 miles tolerance is changes to 20 miles, based on the fact that some drivers have indicated that they are willing to drive a little bit out of their way, and the fact that our distance calculation is based on the geo coordinates of the zip and not the actual address of the driver.
Entering the phone number and clicking the login button doesn't result in any change on the page
Current SMS contains contact details but doesn't make it clear to driver which one is preferred.
Simply add (preferred) after the preferred contact method.
Need to generate UUID (v4) outside of INSERT, so we have it available to send notification back to submitter.
https://blog.tompawlak.org/generate-unique-identifier-nodejs-javascript
I added UUID columns as
UUID | character varying(50) | not null default gen_random_uuid()
However, the default value should not be used, unless we do bulk load of data
The driver receives a notification when the rider cancels but the rider doesn't receive one when the driver cancels.
They may end up waiting and not take action to find alternative transport. Let me know if you need copy for this!
use some html
Need DNS setup for mailgun to register carpoolvote.com domain
The available times are useful to the rider but the assumption will be that they are within the radius (and they may find it confusing if they are a little out).
outgoing_sms table does not contain any text in the body field for a proposed match
In the SMS and email notifications that the rider receives after a driver has confirmed a match, please add: "Please check the license plate number before getting in: xxxxxxxxx"
This is a safety feature, so the rider know they're getting in the right vehicle.
We'd like riders to be able to access the self-service portal even if they are not online. This would have to be done via an operator on the phone line.
Please add:
User support: 804-239-3389
Unclear what this means, so probably also confusing for the driver
I clicked the cancellation button in the email, and was directed to this page: https://api.carpoolvote.com/test/cancel-ride-request?UUID=b409c43a-b581-4a5c-831d-339c1783c8a9&RiderPhone=Westenra
Which just displayed the following text, completely unformatted: {"rider_cancel_ride_request":""}
Can we display something a little more user-friendly? At minimum, an <h1>
saying something like "Your cancellation request has been received, thanks! You should receive an email shortly to confirm the cancellation." However ideally if we could display a proper HTML page, that'd go a long way. I can help with the design.
It seem unable to match if e-mail address is used, no problem is phone number is used.
Is it a problem in node app, or URL encoding ?
How should I write links that I include in notification e-mails.
I see that the driver form now has field for Driver License Number
index.js should now be able to insert it too
Here is the corresponding field in the DB
DriverLicenseNumber | character varying(50) |
And VehicleRegistrationNumber is gone now I think, can be removed from index.js
These can be difficult to manage for people with cognitive difficulties
Is there something shorter/easier that can be assigned? Perhaps something to do with last name, initials, zip code etc?
Driver currently receives contact details for all proposed riders. Instead, they should only receive these details once they have confirmed the match. The street/apartment number should also be separated from the street name (issue #254 on the front end), so it can be sent along with the rest of the contact details.
This is for data protection and safety reasons. The driver can always cancel a match if it doesn't work for some reason.
In the notification above "If you do not wish to..." add "We will send you the rider's full address and contact details if you accept the match"
Next to each confirmed match in the self-service portal (for drivers and riders), add a box that lets drivers/riders record notes for themselves.
This is especially useful for drivers, to keep track if they're arranging multiple rides.
Rider and driver signups no longer redirects to confirmation page after submission. Shows blank page with UUID instead.
Ditto for confirmation page when driver has confirmed a match, rider has cancelled a match, etc
Something like:
https://api.carpoolvote.com/v1.0/drivers/
https://api.carpoolvote.com/v1.1/drivers/
https://api.carpoolvote.com/v1.0/riders/
https://api.carpoolvote.com/v1.1/riders/
https://api.carpoolvote.com/v1.0/helpers/
https://api.carpoolvote.com/v1.1/helpers/
https://api.carpoolvote.com/v2.0/zipcodelookup/
I suspect this would be multiple versions of the node app, running concurrently, in different directories, on different ports, and then nginx handling the routing from /v1.0/* to one port, and /v2.0/* to another port?
We have a few text fields, which will be displayed in the self-service page, and email.
Also the same text fields are used in APIs to manage the ride requests/driver offers.
What should we do against SQL injection ?
Form now seems to send RiderAccommodationNotes (or at least it is there on the rider form)
We can now add code to index.js to store its value in DB
RiderAccommodationNotes | character varying(1000) | | extended | |
Is this because it's all proxied by nginx ?
Allow the submission of Helper data.
Goal is to map unmatched riders
The first phase would be a simple descriptive map of current unmatched driver / rider locations so a simple table would be fine of lat, long, zip, and count, example here: https://github.com/voteamerica/voteamerica.github.io/tree/master/carpool-map/data
I'll provide a view stage.vw_unmatched_riders with the information collected from websumbission_rider and zip_codes tables
I can't explain why we have 207 matches in state MatchConfirmed, but only 57 riders in that state.
Normally, there is one match per rider at most
Report run on Tue Nov 8 12:00:01 UTC 2016
carpool_v2.0_live
DRIVERS
count | state
-------+----------------
250 | Canceled
935 | Pending
448 | MatchProposed
138 | MatchConfirmed
613 | Expired
33 | Failed
(6 rows)
RIDERS
count | state
-------+----------------
31 | Canceled
6 | Pending
57 | MatchConfirmed
6 | MatchProposed
18 | Expired
16 | Failed
(6 rows)
MATCHES
count | state
-------+----------------
800 | Canceled
946 | MatchProposed
207 | MatchConfirmed
(3 rows)
EMAILS
count | state
-------+--------
4940 | Sent
703 | Failed
(2 rows)
SMS
count | state
-------+--------
3040 | Sent
52 | Failed
(2 rows)
For example, for accepting a match,
@jkbits1 Is there a way to return a plain string maybe to confirm success. Right now, it only returns the name of the action and an empty string.
It works, but it does not look nice.
[{"count":"1","zip":"20111","state":"VA","latitude":" 38.769697","longitude":" -77.44915","city":"Manassas","full_state":"Virginia","latitude_numeric":38.7697,"longitude_numeric":-77.4492,"latlong":{"x":38.7696952819824,"y":-77.4491500854492}}]
Error message:
"No Ride Request found for those parameters"
"No Drive Offer found for those parameters"
On the rider form, there would be a polling station address finder.
The complete destination address should be stored in the database
impacts node.js app and possibly sweeper app.
This is useful information for the rider as a starting point for a conversation with the driver.
There are only 33k zip codes out of approx 43k.
Need to find more comprehensive source
[carpool_app@carpoolvote1 db]$ ./show_rider_by_uuid.sh 54aa2a0e-ba6c-4711-8266-9757ca30dff4
carpool_live
Rider Details
uuid | RiderLastName | RiderPhone | RiderEmail | status | status_info | created_ts | last_updated_ts | RiderCollectionZIP | RiderDropOffZIP | TotalPartySize | RiderIsVulnerable | NeedWheelchair | convert_datetime_to_local_format
--------------------------------------+---------------+------------+-----------------------+---------+-------------+----------------------------+----------------------------+--------------------+-----------------+----------------+-------------------+----------------+----------------------------------
54aa2a0e-ba6c-4711-8266-9757ca30dff4 | m | 5719691499 | [email protected] | Pending | | 2017-05-07 14:22:24.004371 | 2017-05-07 14:28:03.275264 | 20111 | 20111 | 1 | f | f | May 07 06:00am-10:00pm
(1 row)
Rider Matches
status | uuid_driver | uuid_rider | score | created_ts | last_updated_ts
----------+--------------------------------------+--------------------------------------+-------+----------------------------+----------------------------
Canceled | 8bae194f-0b1d-4fce-a04c-821932ff93d2 | 54aa2a0e-ba6c-4711-8266-9757ca30dff4 | 82 | 2017-05-07 14:22:47.053326 | 2017-05-07 14:27:53.310019
Canceled | 1960d085-b016-4bb1-acb2-fc1605d4bc2a | 54aa2a0e-ba6c-4711-8266-9757ca30dff4 | 0 | 2017-05-07 14:22:47.053326 | 2017-05-07 14:28:03.275264
(2 rows)
Rider emails
status | subject | created_ts | last_updated_ts | recipient | emission_info
--------+-----------------------------------------------------------------------------------+----------------------------+----------------------------+-----------------------+---------------
Sent | Ride Request received! --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:22:24.004371 | 2017-05-07 14:22:47.346314 | [email protected] | 200 - OK
Sent | You have been matched with a driver! --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:24:01.09684 | 2017-05-07 14:24:19.712572 | [email protected] | 200 - OK
Sent | Ride Request Cancellation Notice --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:27:53.310019 | 2017-05-07 14:28:22.506414 | [email protected] | 200 - OK
(3 rows)
Rider sms
status | created_ts | last_updated_ts | recipient | emission_info
--------+----------------------------+----------------------------+------------+---------------
Sent | 2017-05-07 14:22:24.004371 | 2017-05-07 14:26:44.25842 | 5719691499 |
Sent | 2017-05-07 14:24:01.09684 | 2017-05-07 14:26:44.361226 | 5719691499 |
Sent | 2017-05-07 14:27:53.310019 | 2017-05-07 14:28:14.061146 | 5719691499 |
(3 rows)
[carpool_app@carpoolvote1 db]$ ./show_rider_by_uuid.sh 54aa2a0e-ba6c-4711-8266-9757ca30dff4
carpool_live
Rider Details
uuid | RiderLastName | RiderPhone | RiderEmail | status | status_info | created_ts | last_updated_ts | RiderCollectionZIP | RiderDropOffZIP | TotalPartySize | RiderIsVulnerable | NeedWheelchair | convert_datetime_to_local_format
--------------------------------------+---------------+------------+-----------------------+----------+-------------+----------------------------+----------------------------+--------------------+-----------------+----------------+-------------------+----------------+----------------------------------
54aa2a0e-ba6c-4711-8266-9757ca30dff4 | m | 5719691499 | [email protected] | Canceled | | 2017-05-07 14:22:24.004371 | 2017-05-07 14:29:47.914392 | 20111 | 20111 | 1 | f | f | May 07 06:00am-10:00pm
(1 row)
Rider Matches
status | uuid_driver | uuid_rider | score | created_ts | last_updated_ts
----------+--------------------------------------+--------------------------------------+-------+----------------------------+----------------------------
Canceled | 8bae194f-0b1d-4fce-a04c-821932ff93d2 | 54aa2a0e-ba6c-4711-8266-9757ca30dff4 | 82 | 2017-05-07 14:22:47.053326 | 2017-05-07 14:29:47.914392
Canceled | 1960d085-b016-4bb1-acb2-fc1605d4bc2a | 54aa2a0e-ba6c-4711-8266-9757ca30dff4 | 0 | 2017-05-07 14:22:47.053326 | 2017-05-07 14:29:47.914392
(2 rows)
Rider emails
status | subject | created_ts | last_updated_ts | recipient | emission_info
---------+-----------------------------------------------------------------------------------+----------------------------+----------------------------+-----------------------+---------------
Sent | Ride Request received! --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:22:24.004371 | 2017-05-07 14:22:47.346314 | [email protected] | 200 - OK
Sent | You have been matched with a driver! --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:24:01.09684 | 2017-05-07 14:24:19.712572 | [email protected] | 200 - OK
Sent | Ride Request Cancellation Notice --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:27:53.310019 | 2017-05-07 14:28:22.506414 | [email protected] | 200 - OK
Pending | Ride Request Cancellation Notice --- [54aa2a0e-ba6c-4711-8266-9757ca30dff4] | 2017-05-07 14:29:47.914392 | 2017-05-07 14:29:47.914392 | [email protected] |
(4 rows)
Rider sms
status | created_ts | last_updated_ts | recipient | emission_info
---------+----------------------------+----------------------------+------------+---------------
Sent | 2017-05-07 14:22:24.004371 | 2017-05-07 14:26:44.25842 | 5719691499 |
Sent | 2017-05-07 14:24:01.09684 | 2017-05-07 14:26:44.361226 | 5719691499 |
Sent | 2017-05-07 14:27:53.310019 | 2017-05-07 14:28:14.061146 | 5719691499 |
Pending | 2017-05-07 14:29:47.914392 | 2017-05-07 14:29:47.914392 | 5719691499 |
(4 rows)
recipient address was invalid, record in outgoing_email should have been marked as failed. did not happen
Proposed match SMS notifications going to the driver does not currently contain the details of the ride. We'd like to driver to have an idea of whether the ride could work, before they log in (especially if they've already set up a few rides), so that unnecessary logins don't become a burden.
Please include in the proposed match notifications:
var redirTo = payload._redirect;
[ insert the data]
// redirect the browser to the URL specified in the "Redirect" form variable.
reply.redirect(redirTo);
to be investigated.
A rider record on live environment failed because of this
On top-right of the main landing page in the self-service portal, include a button linking to “Modify details” page. On this page, include all of the information as recorded on the signup form. Allow modification of any of these details (except T&Cs).
Require user to click “Submit” button to save changes.
Prompt user to “Submit” or “Cancel” details if they try to leave after making changes without submitting.
This feature should relieve considerable pressure on the customer service team during election time.
I think it needs a change in the node app
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.