pet-rescue
pet-rescue copied to clipboard
Prevent staff from changing application statuses for matched pets
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:
- Match is created on pet with multiple applications on it (all adopter application statuses are set to
:adoption_made
) - Staff navigates to
http://localhost:3000/alta/pets/8?active_tab=applications
- Staff can still change status of pet from
adoption_made
to any other status. - If status is changed to
:successful_applicant
, theNew Adoption
button becomes active. - 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
- Disable the staff's ability to change the adopter application status after it is set to
:adoption_made
. - Remove these applications from the staff's view completely.
- 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