Prevent AccountRequest and Audit status changes from happening when they shouldn't be changed#5587
Conversation
A rejected or closed account request is a final state that you shouldn't be able to change. For that reason, adding a model validation prevents that from happening.
A finalized audit is a final state that you shouldn't be able to change. For that reason, adding a model validation prevents that from happening from the UI and from other interactions.
|
Passes tech review - over to manual QA. |
|
cc @janeewheatley @ruestitch who are responsible for QA? 👀 |
|
@stefannibrasil Thank you so much for taking this issue on! Sorry for the delay in reviewing. We realized that we want this to not only be about status, but to not allow any edits at all. We tested this for audits and found the following steps to edit a finalized audit:
We should get an error in this last step when we try to confirm an edited audit that has already been finalized. We noticed in the audits controller it prevents destroy of finalized audits, but approach you are using in the model when generalized should catch all cases of editing a finalized audit. Though, it does make us nervous in the controller that edit does a destroy.all. I don't know if the model validation will prevent that. The account request seems fine. Thanks so much! |
janeewheatley
left a comment
There was a problem hiding this comment.
Please see comments above
Resolves #5569
Description
A finalized audit, and rejected or closed account requests are final states that you shouldn't be able to change.
Adding these two validations make the app interaction consistent with other prevented status changes (a cancelled request cannot have its status changed, for example).
For that reason, adding a model validation prevents that from happening from the UI and from other interactions (API, console, etc.)
Type of change
How Has This Been Tested?
Artifacts
Both AccountRequests and Audits UI already prevent rejected/closed and finalized items from having their status changed.
Console testing: