casa icon indicating copy to clipboard operation
casa copied to clipboard

Bug: do not allow invalid dates

Open compwron opened this issue 1 year ago • 2 comments

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.

compwron avatar Apr 26 '24 20:04 compwron

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 —>

ryoung-sf avatar May 07 '24 16:05 ryoung-sf

I want this

compwron avatar May 24 '24 05:05 compwron

CourtDate

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

yes, past permitted

compwron avatar May 26 '24 20:05 compwron

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 avatar May 26 '24 20:05 compwron

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

continue ignoring ignored columns

compwron avatar May 26 '24 20:05 compwron

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

elasticspoon avatar May 26 '24 23:05 elasticspoon

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

marc avatar May 31 '24 17:05 marc