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

API 24828 v2 526 address validation #12795

Merged
merged 0 commits into from
Jun 1, 2023

Conversation

acovrig
Copy link
Contributor

@acovrig acovrig commented May 24, 2023

Summary

  • Validate V2 526 change Of Address

Related issue(s)

Testing done

  • rspec
  • postman

What areas of the site does it impact?

V2 526 submission (and validate)

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

Is it OK to validate beginningDate < endingDate?

@acovrig acovrig added Lighthouse lighthouse claimsApi modules/claims_api labels May 24, 2023
@acovrig acovrig self-assigned this May 24, 2023
@acovrig acovrig requested review from a team as code owners May 24, 2023 16:09
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main May 24, 2023 16:10 Inactive
begin
return if Date.parse(date) < Time.zone.now
rescue
raise ::Common::Exceptions::InvalidFieldValue.new('changeOfAddress.dates.beginningDate', date)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like having this line duplicated, but like the idea of not returning a 500 if you pass "2012-11-31". Also, is changeOfAddress.dates. OK to have for the field name?

raise ::Common::Exceptions::InvalidFieldValue.new('changeOfAddress.dates.beginningDate', date)
end

def validate_form_526_change_of_address_ending_date!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I presume if the endingDate is provided, the beginningDate also will be and that the endingDate should never be before the beginningDate; is that a valid/OK assumption?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable; didn't see anything specific in the Schema Planning spreadsheet about these fields. I did notice that v1 validation on beginningDate included the following--not sure if you think it's wise to add this check as well?
if Date.parse(change_of_address['beginningDate']) > Time.zone.now

Copy link
Contributor

Choose a reason for hiding this comment

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

Disregard that, you've already got a check for that.

@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 24, 2023 21:54 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main May 24, 2023 21:55 Inactive
end

context 'when no mailing address data is found' do
it 'responds with bad request' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be updated to 'responds with a 422'?

Copy link
Contributor

Choose a reason for hiding this comment

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

let's start leaving notes on these once we've made a decision. Or simply resolving the conversation if we went with the suggestions / comments. Assuming since this PR had previous approval, we're good to approve it, but be good to get in that habit. 👍

raise ::Common::Exceptions::InvalidFieldValue.new('changeOfAddress.dates.beginningDate', date)
end

def validate_form_526_change_of_address_ending_date!
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable; didn't see anything specific in the Schema Planning spreadsheet about these fields. I did notice that v1 validation on beginningDate included the following--not sure if you think it's wise to add this check as well?
if Date.parse(change_of_address['beginningDate']) > Time.zone.now

Copy link
Contributor

@mchristiansonVA mchristiansonVA left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 31, 2023 14:42 In progress
@acovrig acovrig changed the title A pi 24828 v2 526 address validation API 24828 v2 526 address validation May 31, 2023
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 31, 2023 14:42 In progress
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 31, 2023 15:01 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main May 31, 2023 15:07 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 31, 2023 15:14 In progress
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 31, 2023 15:28 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main May 31, 2023 15:38 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main May 31, 2023 20:53 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main May 31, 2023 20:53 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main June 1, 2023 01:58 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main June 1, 2023 01:58 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to APi-24828-v2-526-address-validation/main/main June 1, 2023 14:18 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to APi-24828-v2-526-address-validation/main/main June 1, 2023 14:18 Inactive
Copy link
Contributor

@mchristiansonVA mchristiansonVA left a comment

Choose a reason for hiding this comment

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

Tested locally with Postman. Looks good to me.

@acovrig acovrig merged commit 2dd990e into master Jun 1, 2023
@acovrig acovrig deleted the APi-24828-v2-526-address-validation branch June 1, 2023 14:43
ryan-mcneil pushed a commit that referenced this pull request Dec 11, 2023
* Validate Change Of Address

* Fix typo

* Fix tests

---------

Co-authored-by: Austin Covrig <austin.covrig@oddball.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claimsApi modules/claims_api Lighthouse lighthouse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants