Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds validation to consulation date fields (admission_date, discharge_date, death_datetime) #1415

Merged
merged 11 commits into from
Jul 5, 2023

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Jun 27, 2023

Proposed Changes

  • Adds validation for admission_date: disallow future.
  • Adds validation for discharge_date: disallow future and disallow before admission_date
  • Adds validation for death_datetime: disallow future and disallow before admission_date

Associated Issue

image image image image image

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@rithviknishad rithviknishad marked this pull request as ready for review June 27, 2023 16:16
@rithviknishad rithviknishad added waiting-for-review P1 High priority; urgent labels Jun 27, 2023
@vigneshhari
Copy link
Member

@rithviknishad Need to fix tests.

@@ -136,7 +137,7 @@ def test_user_can_read_all(self):
self.assertEqual(response.status_code, status.HTTP_200_OK)
res_data_json = response.json()
# test total user count
self.assertEqual(res_data_json["count"], 2) # 2 existing, plus the new one
self.assertEqual(res_data_json["count"], 3) # 3 existing, plus the new one
Copy link
Member

Choose a reason for hiding this comment

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

instead of hardcoding 3, we can fetch that value from the database. maybe in a separate ticket.

@vigneshhari vigneshhari merged commit 4163d74 into master Jul 5, 2023
@vigneshhari vigneshhari deleted the consultation-datefields-validation branch July 5, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority; urgent waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add proper validations for discharge_date admission_date and death_datetime
3 participants