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

More cat 4 #2879

Merged
merged 36 commits into from
May 17, 2024
Merged

More cat 4 #2879

merged 36 commits into from
May 17, 2024

Conversation

jtimpe
Copy link

@jtimpe jtimpe commented Mar 8, 2024

Summary of Changes

Pull request closes #2842. Completes the implementation of cat4 validations with the following

  • "only one" t1/t4
  • adults in territories must have a valid value for 19C
    • people in states shouldn’t have value of 1
    • people in states must have valid value
  • if case closure reason = 01:employment, then at least one person on the case must have employment status = 1:Yes in the same month
  • if closure reason = FTL, then at least one person who is HoH or spouse of HoH on case must have FTL months >=60 (ssp only)
    • @jtimpe i assume here you mean "tanf only" since SSP does not have a FTL months field?

How to Test

cd tdrs-backend && docker-compose up
cd tdrs-frontend && docker-compose up --build
  1. Open http://localhost:3000/ and sign in.
  2. Submit section 2 test files

Demo GIF(s) and screenshots for testing procedure

Deliverables

More details on how deliverables herein are assessed included here.

Deliverable 1: Accepted Features

Checklist of ACs:

  • implement set 2 of the remaining validators
  • lfrohlich and/or adpennington confirmed that ACs are met.

Deliverable 2: Tested Code

  • Are all areas of code introduced in this PR meaningfully tested?
    • If this PR introduces backend code changes, are they meaningfully tested?
    • If this PR introduces frontend code changes, are they meaningfully tested?
  • Are code coverage minimums met?
    • Frontend coverage: [insert coverage %] (see CodeCov Report comment in PR)
    • Backend coverage: [insert coverage %] (see CodeCov Report comment in PR)

Deliverable 3: Properly Styled Code

  • Are backend code style checks passing on CircleCI?
  • Are frontend code style checks passing on CircleCI?
  • Are code maintainability principles being followed?

Deliverable 4: Accessible

  • Does this PR complete the epic?
  • Are links included to any other gov-approved PRs associated with epic?
  • Does PR include documentation for Raft's a11y review?
  • Did automated and manual testing with iamjolly and ttran-hub using Accessibility Insights reveal any errors introduced in this PR?

Deliverable 5: Deployed

  • Was the code successfully deployed via automated CircleCI process to development on Cloud.gov?

Deliverable 6: Documented

  • Does this PR provide background for why coding decisions were made?
  • If this PR introduces backend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces frontend code, is that code easy to understand and sufficiently documented, both inline and overall?
  • If this PR introduces dependencies, are their licenses documented?
  • Can reviewer explain and take ownership of these elements presented in this code review?

Deliverable 7: Secure

  • Does the OWASP Scan pass on CircleCI?
  • Do manual code review and manual testing detect any new security issues?
  • If new issues detected, is investigation and/or remediation plan documented?

Deliverable 8: User Research

Research product(s) clearly articulate(s):

  • the purpose of the research
  • methods used to conduct the research
  • who participated in the research
  • what was tested and how
  • impact of research on TDP
  • (if applicable) final design mockups produced for TDP development

@jtimpe jtimpe self-assigned this Mar 8, 2024
@jtimpe jtimpe added the raft review This issue is ready for raft review label Apr 9, 2024
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.10%. Comparing base (78201e0) to head (5e98971).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2879      +/-   ##
===========================================
+ Coverage    92.97%   93.10%   +0.12%     
===========================================
  Files          272      272              
  Lines         6965     7049      +84     
  Branches       572      590      +18     
===========================================
+ Hits          6476     6563      +87     
+ Misses         395      392       -3     
  Partials        94       94              
Flag Coverage Δ
dev-backend 93.18% <100.00%> (+0.14%) ⬆️
dev-frontend 92.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...d/tdpservice/parsers/case_consistency_validator.py 97.82% <100.00%> (+3.15%) ⬆️
tdrs-backend/tdpservice/parsers/parse.py 89.91% <ø> (ø)
tdrs-backend/tdpservice/parsers/test/factories.py 100.00% <100.00%> (ø)
tdrs-backend/tdpservice/parsers/util.py 90.78% <100.00%> (+0.51%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 562c086...5e98971. Read the comment docs.

@jtimpe jtimpe force-pushed the 2842-cat-4-remaining-s2-validators branch from bebaf2d to d979685 Compare April 12, 2024 17:31
Copy link

@raftmsohani raftmsohani left a comment

Choose a reason for hiding this comment

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

LGTM except the test are not passing yet

@jtimpe jtimpe requested a review from raftmsohani April 16, 2024 19:33
field='RPT_MONTH_YEAR',
msg=(
f'There should only be one {t1_model_name} record '
f'for a RPT_MONTH_YEAR and CASE_NUMBER.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'for a RPT_MONTH_YEAR and CASE_NUMBER.'
f'per RPT_MONTH_YEAR and CASE_NUMBER.'

field='RPT_MONTH_YEAR',
msg=(
f'There should only be one {t4_model_name} record '
f'for a RPT_MONTH_YEAR and CASE_NUMBER.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'for a RPT_MONTH_YEAR and CASE_NUMBER.'
f'per RPT_MONTH_YEAR and CASE_NUMBER.'


if closure_reason == '01':
num_errors += self.__validate_case_closure_employment(t4, t5s, (
'At least one person on the case must have employment status = 1:Yes in the same month.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jtimpe suggested language for this one from the DIGIT team:

At least one person on the case must have employment status = 1:Yes in the same RPT_MONTH_YEAR since CLOSURE_REASON = 1:Employment/excess earnings.

))
elif closure_reason == '99' and not is_ssp:
num_errors += self.__validate_case_closure_ftl(t4, t5s, (
'At least one person who is HoH or spouse of HoH on case must have FTL months >=60.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jtimpe do we mean closure_reason == '03' and not is_ssp?

Screenshot 2024-05-16 141837 PNG

Copy link
Author

Choose a reason for hiding this comment

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

yep, thank you

@ADPennington ADPennington removed the Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI label May 17, 2024
record,
field='REC_SSI',
msg=(
f'{t5_model_name} People in territories must have a valid value for 19E.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'{t5_model_name} People in territories must have a valid value for 19E.'
f'{t5_model_name} People in territories must have value = 2:No for 19E.'

record,
field='REC_AID_TOTALLY_DISABLED',
msg=(
f'{t5_model_name} People in states shouldn\'t have a value of 1.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'{t5_model_name} People in states shouldn\'t have a value of 1.'
f'{t5_model_name} People in states should not have a value of 1.'

@ADPennington ADPennington added the Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI label May 17, 2024
record,
field='REC_SSI',
msg=(
f'{t5_model_name} People in states must have a valid value.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jtimpe can we add the following? I just noticed that the other columns in the error report dont make reference to which field or row this error message is associated with. thats probably another ticket, so in the meantime, we should reference field in the error message:

f'{t5_model_name}: People in states must have a valid value for {field}'

Copy link
Author

Choose a reason for hiding this comment

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

per our discussion, i've hard-coded the field names into the string for now, and created #2996 to capture a dynamic approach to including the field/friendly name

record,
field='REC_AID_TOTALLY_DISABLED',
msg=(
f'{t5_model_name} People in states should not have a value of 1.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'{t5_model_name} People in states should not have a value of 1.'
f'{t5_model_name} People in states should not have a value of 1 for {field}'

suggestion, assuming {field} can be inserted. else, need the field name.

record,
field='REC_SSI',
msg=(
f'{t5_model_name} People in territories must have value = 2:No for 19E.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'{t5_model_name} People in territories must have value = 2:No for 19E.'
f'{t5_model_name} People in territories must have value = 2:No for {field}.'

record,
field='REC_AID_TOTALLY_DISABLED',
msg=(
f'{t5_model_name} Adults in territories must have a valid value for 19C.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'{t5_model_name} Adults in territories must have a valid value for 19C.'
f'{t5_model_name} Adults in territories must have a valid value for {field}.'

@ADPennington ADPennington added Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI and removed Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI labels May 17, 2024
))
elif closure_reason == '03' and not is_ssp:
num_errors += self.__validate_case_closure_ftl(t4, t5s, (
'At least one person who is HoH or spouse of HoH on case must have FTL months >=60.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'At least one person who is HoH or spouse of HoH on case must have FTL months >=60.'
'At least one person who is head-of-household or spouse of head-of-household on case must have countable months toward time limit >= 60 since CLOSURE_REASON = 03: federal 5 year time limit.'

@ADPennington ADPennington removed the Deploy with CircleCI-qasp Deploy to https://tdp-frontend-qasp.app.cloud.gov through CircleCI label May 17, 2024
Copy link
Collaborator

@ADPennington ADPennington left a comment

Choose a reason for hiding this comment

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

lgtm @jtimpe 🚀 had one more language suggestion before this merges. i do not need to re-test.

@jtimpe jtimpe merged commit 9bcf9b9 into develop May 17, 2024
19 checks passed
@jtimpe jtimpe deleted the 2842-cat-4-remaining-s2-validators branch May 17, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complete cat4 validation implementation
4 participants