Skip to content

Conversation

@ChaelCodes
Copy link
Contributor

What github issue is this PR for, if any?

Resolves #806

What changed, and why?

court_report_submitted as a boolean only tracked whether or not the report had been submitted. It did not track when it was submitted nor if it was completed. This PR adds court_report_status which tracks the current status of the court report, and court_report_submitted_at which tracks when it was submitted.

Cases will now have a court report status of 'Not submitted' by default. All users can update court_report_status. When the court_report_status is set to 'Submitted', 'In review', or 'Completed' for the first time, the court_report_submitted_at field is immediately set. If the court_report_status is ever set to 'Not submitted', the court_report_submitted_at date field will be cleared.

This PR also adds an after_party backfill that modifies all cases that were previously marked as court_report_submitted. All cases will be updated to have a court_report_submitted_at of the current date and court_report_status of submitted.

How will this affect user permissions?

  • Volunteer permissions: No Change
  • Supervisor permissions: No Change
  • Admin permissions: No Change

How is this tested? (please write tests!) 💖💪

  • Using Unit tests, and updating the request specs for casa cases

Screenshots

Details Page - Not Submitted (court_report_status: :not_submitted, court_report_submitted_at: nil)

Details Page - Submitted (court_report_status: :submitted, court_report_submitted_at: '2020-11-08 18:29:16')

Details Page - Completed (court_report_status: :completed, court_report_submitted_at: '2020-11-08 18:29:16')

Edit Page
image

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Nov 8, 2020
@@ -0,0 +1,14 @@
namespace :after_party do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay backfill!

Copy link
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! :)

@compwron compwron merged commit 564220f into rubyforgood:main Nov 8, 2020
@ChaelCodes
Copy link
Contributor Author

@compwron hey! This is awkward, I should've made this as a draft PR, but some of the specs still aren't passing in this version.

@compwron
Copy link
Collaborator

compwron commented Nov 8, 2020

@ChaelCodes weird, the build looked green O.o maybe I am confused. Please make a new PR when you have a chance, I'll revert or xit on master.

@ChaelCodes
Copy link
Contributor Author

@compwron I made a new PR - #1285 It should fix the build, but I'm still waiting on Travis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supervisors/admins can edit court report submission status

2 participants