rubyforgood / homeward-tails

Homeward Tails is an application making it easy to link adopters/fosters with pets. We work with grassroots pet rescue organizations to understand how we can make the most impact.
MIT License
70 stars 117 forks source link

Prevent staff from changing application statuses for matched pets #579

Open mononoken opened 8 months ago

mononoken commented 8 months ago

On hold pending feedback for desired solution. Please read below.

Problem

578 added validations to prevent multiple matches for the same pet as well as to ensure adopters can only apply for a pet once.

However, this flow is currently possible:

  1. Match is created on pet with multiple applications on it (all adopter application statuses are set to :adoption_made)
  2. Staff navigates to http://localhost:3000/alta/pets/8?active_tab=applications
  3. Staff can still change status of pet from adoption_made to any other status.
  4. If status is changed to :successful_applicant, the New Adoption button becomes active.
  5. If they click "New Adoption", the new validations prevent a new match from being generated, and they receive a curt "Error" flash from the controller.

The data is protected in regards to the matches, but the adopter applications feel like they need more cleanup after a match is made.

Solutions

  1. Disable the staff's ability to change the adopter application status after it is set to :adoption_made.
  2. Remove these applications from the staff's view completely.
  3. Soft delete adopter applications after the match is made.

Any others? Is this not worth considering?

I think this would also be related to whether or not it is possible for a match to be destroyed. I think that topic was mentioned in the last meeting, but I don't remember if a clear direction was chosen on that.

📷 Screenshots/Demos

Clip of the flow, where it is currently possible to update statuses of applications for adopted/matched pets.

https://github.com/rubyforgood/pet-rescue/assets/81536479/b9231f1f-3422-4af0-bb83-51a261a2549b

nsiwnf commented 8 months ago

Yeah, curious what stakeholders would say. Like, do they ever have something like a 1-year check-in after adoption, "how's it going with Rosco?"

kasugaijin commented 7 months ago

The way I handled this on the original app was to leave adopter applications in place and allowed staff to destroy a match. This is going to be very rare, but in some cases it doesn’t work out and the dog comes back. I thought leaving the adopter applications in place would allow staff to see who else was interested in the dog so they could reach out and let them know the dog was back. The adoption was destroyed while viewing the pet, not applications.

We could follow a similar flow.