pet-rescue icon indicating copy to clipboard operation
pet-rescue copied to clipboard

Prevent staff from changing application statuses for matched pets

Open mononoken opened this issue 11 months ago • 2 comments

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

mononoken avatar Mar 21 '24 04:03 mononoken