Bug: do not allow invalid dates
Impacted User Types
all
Environment
all
Current Behavior
[ex: When I click "generate report," no report is generated. Please include a screenshot!](bug: this is possible on page like https://casa-qa.herokuapp.com/casa_cases/cina-05-1087/court_dates/1123)
https://rubyforgood.slack.com/archives/CVB0QJGVD/p1714160389231339
How to Replicate
ex:
-
- Log in as an admin or supervisor.
-
- Click on "Generate Reports" in the left sidebar menu.
-
- Filter by a volunteer who has logged at least one case contact.
-
- Click "Generate report" at the bottom of the page.
How to access the QA site
Login Details:
Link to QA site
Login Emails:
- [email protected] view site as a volunteer
- [email protected] view site as a supervisor
- [email protected] view site as an admin
- [email protected] view site as an all casa admin
- go to
/all_casa_admins/sign_in
- go to
password for all users: 12345678
Questions? Join Slack!
We highly recommend that you join us in slack #casa channel to ask questions quickly. And discord for office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.
Hi - I can takes this. Adding validations to the datetime objects on the models looks like the best way to go. Are there specific ranges for each of the objects? Here is the list of objects with datetimes (ex. timestamps) and the validation
CaseCase
- birth_month_year_youth —> range from 1989 to today
- court_report_due_date —> ignored column, ok not to have a maximum due_date?
- court_report_submitted_at —> This is set when the case is created, max should be date case created?
- date_in_care —> range is from 1989 to today
CaseContact
- occurred_at —> already validates can’t be in future
CourtDate
- date —> max date a year from now, should dates in the past be permitted?
- court_report_due_date —> not sure
learning_hours
- occurred_at —> already a max, assume ok with out a minimum
MileageRate
- effective_date —> max date be in the past
OtherDuties
- occurred_at —> should max date be in the past?
PlacementsStartedAt
- Placement_started_at —> not clear the usage
User
- date_of_birth —> range from 1920 to today
UserReminderTime
- case_contact_types —>
- no_contact_made —>
I want this
CourtDate
date —> max date a year from now, should dates in the past be permitted?
yes, past permitted
Placement_started_at —> not clear the usage
this should be roughly the same range as the date in care range, placement is where the youth lives and with whom
court_report_due_date —> ignored column, ok not to have a maximum due_date?
continue ignoring ignored columns
@ryoung-sf hey, sorry bout taking to long to get back to you on this. are you still interested in doing this? I think there should be enough info now?
Per conversation: For CourtDate.date validations, allow one year in the future and allow past dates but limit to 1/1/1989 or later.