806 use Court Report Status instead of Court Report Submitted #1284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What github issue is this PR for, if any?
Resolves #806
What changed, and why?
court_report_submittedas 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 addscourt_report_statuswhich tracks the current status of the court report, andcourt_report_submitted_atwhich 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 thecourt_report_statusis set to 'Submitted', 'In review', or 'Completed' for the first time, thecourt_report_submitted_atfield is immediately set. If thecourt_report_statusis ever set to 'Not submitted', thecourt_report_submitted_atdate 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 acourt_report_submitted_atof the current date andcourt_report_statusof submitted.How will this affect user permissions?
How is this tested? (please write tests!) 💖💪
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