rubyforgood / casa

Volunteer management system for nonprofit CASA, which serves foster youth in counties across America.
https://casavolunteertracking.org/
MIT License
314 stars 478 forks source link

Bug: do not allow invalid dates #5646

Closed compwron closed 5 months ago

compwron commented 6 months ago

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

image

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:

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.

ryoung-sf commented 6 months ago

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

CaseContact

CourtDate

learning_hours

MileageRate

OtherDuties

PlacementsStartedAt

User

UserReminderTime

compwron commented 5 months ago

I want this

compwron commented 5 months ago

CourtDate

date —> max date a year from now, should dates in the past be permitted?

yes, past permitted

compwron commented 5 months ago

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

compwron commented 5 months ago

court_report_due_date —> ignored column, ok not to have a maximum due_date?

continue ignoring ignored columns

elasticspoon commented 5 months ago

@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?

marc commented 5 months ago

Per conversation: For CourtDate.date validations, allow one year in the future and allow past dates but limit to 1/1/1989 or later.