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

Staff: As staff I can review an adopter's information on their application #1048

Closed
kasugaijin opened this issue Oct 9, 2024 · 14 comments
Closed
Assignees

Comments

@kasugaijin
Copy link
Collaborator

When logged in as staff, I can go to /adoption_application_reviews to see all of the applications on a pet. But I cannot click on the adopter name to see their information.

Every User has a Person model. So, each adopter's information is stored on the person.latest_form_submission.form_answers. This will give you a list of records, each with a question snapshot and value (answer). (Nice to know, these form answers will come from a CSV uploaded by staff that matches the Person's email with a response in the CSV from a form like Google form). We need to show these questions and answers to the staff. Note, that we don't need to worry about grouping questions, for MVP we will just show a list of questions and aswers, however they come in the CSV (it's likely grouped in the original form anyway so that grouping should be loosely retained here).

To do:

  • add a route and show action for Organizations::Staff::AdoptionApplicationReviewsController that will show the adopter's information. This information is stored as form answers on the adopter's Person model's latest_form_submission.
  • authorize the route to make sure the staff is in the same organization as the adopter, and has review_adopter_applications permission
  • add the adopter's name as a link in the table for adopter applications, and when I click on it, redirect me to the show page
  • the show page will be very simple, rendered in the staff dashboard per the sketch below
  • I think the edit route/action on this controller is redundant - please check and remove it if so
  • Please add some seed data so each adopter user has some form answers on their form submission

Questions and answers
Image

@kasugaijin kasugaijin added the Ready Make a comment to get assigned. label Oct 9, 2024
@Aaryanpal
Copy link
Contributor

@kasugaijin Will Please Assign this

@kasugaijin kasugaijin removed the Ready Make a comment to get assigned. label Oct 9, 2024
@kasugaijin
Copy link
Collaborator Author

@Aaryanpal how's this going?

@kasugaijin kasugaijin added the Ready Make a comment to get assigned. label Nov 13, 2024
@kasugaijin
Copy link
Collaborator Author

Issue up for grabs!

@sarvaiyanidhi
Copy link
Contributor

Hi @kasugaijin I would like to work on this issue if it is still open..

@kasugaijin
Copy link
Collaborator Author

All yours @sarvaiyanidhi

@kasugaijin kasugaijin removed the Ready Make a comment to get assigned. label Nov 14, 2024
@sarvaiyanidhi
Copy link
Contributor

Hi @kasugaijin ,

I believe that I need to upload some sample data from this location staff/external_form_upload

Do you have any sample format of CSV which can be used to upload details, basically I need to know apart from person email field what all other fields needs to be uploaded?

Not sure if required but I think we should also provide sample CSV format to download so that user can update data in it and upload it back.

@kasugaijin
Copy link
Collaborator Author

kasugaijin commented Nov 18, 2024

@sarvaiyanidhi for this there’s no defined dataset per se. We need to take the users latest form submission and then iterate over all of its form answers and show the question and response. You can make up whatever you like for the dummy data in the tests. For example you could include
Have you owned a dog before
What kind of housing do you live in
What’s your preference for dog temperament
How much have you budgeted for a dog per year
Etc etc.
ChatGPT will be good if you ask it for 10 questions on a dog adoption form

Each organization will have their own set of questions that get uploaded

Does that help?

@sarvaiyanidhi
Copy link
Contributor

Thanks @kasugaijin , I was just trying to upload sample CSV from /external_form_upload path but nothing was getting inserted in form_answers table so I thought I am missing something.. Never mind I will update seed data to insert some data in form_answers as well which can be used to display in required functionality.

@kasugaijin
Copy link
Collaborator Author

Yeh we might need to update the seed adopter account to have a form submission. If the adopter doesn’t have a form submission I don’t think it will upload. On my cell right now so can’t look at it just yet

@kasugaijin
Copy link
Collaborator Author

Also double check your CSv has the date time. Check the csv import service for what it looks for

@sarvaiyanidhi
Copy link
Contributor

Sure thanks.. Will check it and try to upload accordingly

@jmilljr24
Copy link
Collaborator

@sarvaiyanidhi I have a csv file linked in #1112 that might help you. That should add a few form submission to "Alta" adopters. The email has to match a user in the db. You will probably want to watch the logs during upload as we currently do not have any UI indications for success/failure.

@sarvaiyanidhi
Copy link
Contributor

Thanks @jmilljr24 I was able to get few sample form_answers updated using sample CSV. Just one question, I see that question_id is nil for submitted_answers so I think I need not worry about that data for this feature?

@kasugaijin Using sample CSV, we have below details updated in forms_answers table along with other values like form_submission_id, organization_id

| value | question_snapshot |
| Emile | First Name |
| Mills | Last Name |
| "74936 Kiesha Turnpike, Port Tarshaton, ME 18261-0840" | Address |
| "452.143.5817" | Phone Number |
| "Sunt placeat quod." | "What type of pet are you interested in adopting? (Dog, Cat, Other)"|
| "Velit eos officiis." | "What is your living situation? (House, Apartment, Condo, etc.)" |
--- more

Just want to confirm that when I am displaying information in new screen, I will also be displaying details like First Name, Last Name, Address, Phone Number along with other questions as I will loop through latest form_submission_answers or I need to filter these details like Name, Address etc and just display generic questions (like What type of pet are you interested in adopting? (Dog, Cat, Other)) and answers?

@kasugaijin
Copy link
Collaborator Author

@sarvaiyanidhi for now let’s display all of the associated form answers (question and answer). No need to filter anything

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

No branches or pull requests

4 participants