Closed annamot9 closed 2 years ago
Is there a reason to search by all three columns? "by patient last name, and hospital city and state."
Here is a spreadsheet of what the nominations table looks like in the database, for reference: nomination table in database
Some rows might have duplicated values for these three columns and you might not get the correct google folder id for the nomination to which this email refers.
Perhaps we can use the unique identifier in the first column in the database?
I'm sorry, I don't know how the exactly how emails work from a product perspective in this project (like when and from where this email is received by ksf). I suspect this email is sent when the "mark stage as complete" button is pressed the first time (but really not sure). I have experience in using unique identifiers in emails from users in production to read from and update specific rows in a database. If we can schedule a talk about this in the future, I think we can formulate a for sure way to guarantee getting the correct google drive folder id from the db in order to update the google drive folder that belongs to the exact nomination to which this email would specifically refer.
It would be one less step for things to go wrong, and would guarantee that the documents get to where they need to go in google drive.
There was probably a talk among ksf product and perhaps tech leads that I was not involved in about this ticket. I am proposing that a plan to use the unique identifier instead of the three columns mentioned would be a better way to go about this ticket.
Perhaps including a link in an email that can be clicked on to open the correct google drive folder in which the admin can manually place documents would be a good alternative to this? This email would be sent to the admin when "mark stage is complete" button is clicked. I don't know who would be generating these documents. I'm just guessing it is the admin (i.e. Bill, our client).
If the applicant is generating these documents and emailing them, a unique identifier can be hidden within an email and sent to the applicant. They could then reply to it with attachments. Our api would read this email, grab the html, get the hidden html text and upload the attachments to the appropriate google drive folder.
Perhaps this ticket is a blocker as well to this ticket? https://app.zenhub.com/workspaces/ksf-5f23520d91f7ee00134cbaf6/issues/the-difference-engine/ksf/109
This ticket (#365) could be split into two tickets (the email receiving hidden nomination id part to @Lcole490 and @hedrarowan) and the email sending hidden nomination id to @somersbmatthews , @KeenanJones1 and @ZeroJimmy100
An entirely separate ticket to be merged with develop BEFORE #109 and #191 would definitely help unify the system to store the google drive folder id. The "google drive folder task force" including @somersbmatthews @ZeroJimmy100 @Lcole490 @hedrarowan and @KeenanJones1 . Would be much more efficient at getting the google drive folder documents uploading email attachments feature fully implemented if we worked together.
Ticket #109 and #191 might be implementing diverging strategies that would hinder future development (e.g. this ticket #368)
the above is a proposal. I'm not trying to tell anyone what to do.
Works fine
In order to better find the right application folder to add the attachments that are being received, since the folder ID is kept in the DB, the search should use that to find the right folder. The search for the folder ID should be by patient last name, and hospital city and state.
Acceptance Criteria: [ ] When the email received to the nomination@keepswimmingfoundation.org with attachments is being processed, since the patient last name, hospital city and hospital state appear in the subject of the email, the search should find the application in the DB and retrieve the folder ID. [ ] Once the folder ID is identified, the attachment from the email should be added to the folder.