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

#82765 [10-10EZR]: Add/update a form submission's veteranDateOfBirth if it's missing or blank #16699

Merged
merged 8 commits into from
May 14, 2024

Conversation

JoshingYou1
Copy link
Contributor

@JoshingYou1 JoshingYou1 commented May 9, 2024

Summary

  • Adds a method to "post-fill" veteranDateOfBirth in the form params if it's missing or blank. We'll utilize the current_user's session by setting the form value to the birth_date value. This is to hopefully resolve the schema validation error related to veteranDateOfBirth we've been seeing on and off.

Related issue(s)

Testing done

  • New code is covered by unit tests

What areas of the site does it impact?

  • 10-10EZR form

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@va-vfs-bot va-vfs-bot temporarily deployed to 82765_1010_ezr_postfill_veteran_dob/main/main May 9, 2024 17:39 Inactive
@JoshingYou1 JoshingYou1 marked this pull request as ready for review May 9, 2024 19:36
@JoshingYou1 JoshingYou1 requested review from a team as code owners May 9, 2024 19:36
def post_fill_veteran_date_of_birth(parsed_form)
return if parsed_form['veteranDateOfBirth'].present?

user_dob = @user.birth_date
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious if you want to log or send a metric to DD when this post-fill happens? That way we'll know how often it's taking place and for who

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be cool! Did you have something in mind for tracking the "who" in these scenarios? I'm fairly certain logging PHI is frowned upon unless it's for something important. Also, regarding logging, do you mean like a regular rails log or something more robust? The problem with rails logs is I think we'd probably run into an issue of tracking WHEN this occurs. What do you think?

@va-vfs-bot va-vfs-bot temporarily deployed to 82765_1010_ezr_postfill_veteran_dob/main/main May 9, 2024 20:18 Inactive
dellerbie
dellerbie previously approved these changes May 9, 2024
Copy link
Contributor

@dellerbie dellerbie left a comment

Choose a reason for hiding this comment

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

non-blocking comments/questions

return if parsed_form['veteranDateOfBirth'].present?

user_dob = @user.birth_date
parsed_form['veteranDateOfBirth'] = user_dob if user_dob.present?
Copy link
Contributor

Choose a reason for hiding this comment

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

Almost feel like you don't need the if since parsed_form['veteranDateOfBirth'] is nil already when this line executes; you would just be setting it to nil again, which it already is. One less conditional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed! It has been removed. Thanks Derrick!

@va-vfs-bot va-vfs-bot temporarily deployed to 82765_1010_ezr_postfill_veteran_dob/main/main May 10, 2024 18:19 Inactive
@JoshingYou1 JoshingYou1 merged commit 61813f5 into master May 14, 2024
19 checks passed
@JoshingYou1 JoshingYou1 deleted the 82765_1010_ezr_postfill_veteran_dob branch May 14, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants