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 24835 526 v2 section 8 direct deposit information validation #12818

Conversation

rockwellwindsor-va
Copy link
Contributor

Adds direct deposit validation - section 8

Summary

  • Adds validataion for direct deposit elements
  • Updates 526.json schema file and related files to ensure correct validations
  • Updates rswag docs with update schema
  • Adds RSpec tests for validations

Related issue(s)

API-24835

Testing done

RSpec

What areas of the site does it impact?

modified: modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb
modified: modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json
modified: modules/claims_api/config/schemas/v2/526.json
modified: modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/example.json
modified: modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/request.json
modified: modules/claims_api/spec/fixtures/v2/veterans/disability_compensation/form_526_json_api.json
modified: modules/claims_api/spec/requests/v2/veterans/disability_compensation_request_spec.rb
modified: spec/support/schemas/claims_api/v2/forms/disability/submission.json

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

I had to update the schema for the direct deposit object. Specifically one area that could use a heavier glance is the 'accountType' set up. It does pass the tests scenarios and validations but it was the first time I had to use oneOf. I believe I have it correct according to the OAS docs but if someone wants to give that an extra glance it might be worth digging at a little bit just to make sure.

@github-actions
Copy link

github-actions bot commented May 26, 2023

1 Warning
⚠️ This PR changes 387 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb (+49/-0)

  • modules/claims_api/spec/lib/claims_api/v2/disability_compensation_pdf_mapper_spec.rb (+2/-2)

  • modules/claims_api/spec/requests/v2/veterans/disability_compensation_request_spec.rb (+334/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 26, 2023 15:32 Inactive
@rockwellwindsor-va rockwellwindsor-va added the claimsApi modules/claims_api label May 26, 2023
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review May 26, 2023 17:29
@rockwellwindsor-va rockwellwindsor-va requested review from a team as code owners May 26, 2023 17:29
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 14:12 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 14:13 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 14:53 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 14:53 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 16:32 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 16:37 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 17:05 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 30, 2023 17:05 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 11:57 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 11:57 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 13:53 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 13:56 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 19:03 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 19:03 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 19:03 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 19:33 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 19:45 Inactive
@rockwellwindsor-va rockwellwindsor-va marked this pull request as draft May 31, 2023 21:18
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 21:47 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 21:47 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 21:59 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main May 31, 2023 22:01 Inactive
@stiehlrod stiehlrod added the Lighthouse lighthouse label Jun 1, 2023
stiehlrod
stiehlrod previously approved these changes Jun 1, 2023
@@ -195,7 +195,7 @@
},
"directDeposit": {
"accountType": "CHECKING",
"accountNumber": "123456789",
"accountNumber": "123123123123",
"routingNumber": "123456789",
"financialInstituteName": "Chase",
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in example field name...this should be "financialInstitutionName"

@rockwellwindsor-va rockwellwindsor-va marked this pull request as draft June 1, 2023 16:01
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 1, 2023 16:05 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 1, 2023 16:06 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 1, 2023 16:12 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 1, 2023 16:19 Inactive
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review June 1, 2023 16:25
return if direct_deposit.blank?

direct_deposit['noAccount'] == true ? validate_no_account! : validate_account_values!
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: What if there is not a value for noAccount?

irb(main):009:0> form_attributes = { "directDeposit"=> { "accountType"=> 'Checking', 'accountNumber'=> '3453425235' } }
=> {"directDeposit"=>{"accountType"=>"Checking", "accountNumber"=>"3453425235"}}
irb(main):010:0> direct_deposit = form_attributes['directDeposit']
=> {"accountType"=>"Checking", "accountNumber"=>"3453425235"}
irb(main):011:0> direct_deposit['noAccount'] == true ? 'yes' : 'no'
=> "no"

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that is okay, just want to run it by you.

Copy link
Contributor Author

@rockwellwindsor-va rockwellwindsor-va Jun 1, 2023

Choose a reason for hiding this comment

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

you're right, it can be more robust, updating that now. It is kind of unintentionally safe. Since we only get to that point if values are present, if 'noAccount' is not present we still go the right place, but looking at the code it would be better to be more intentional on that safeguarding both for the code and for readability by others.

@rockwellwindsor-va rockwellwindsor-va marked this pull request as draft June 1, 2023 18:35
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 1, 2023 18:58 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 1, 2023 19:04 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 2, 2023 13:24 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 2, 2023 13:24 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 2, 2023 18:51 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 2, 2023 18:53 Inactive
@rockwellwindsor-va rockwellwindsor-va marked this pull request as ready for review June 2, 2023 19:02
@va-vsp-bot va-vsp-bot requested a deployment to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 5, 2023 11:40 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to API-24835-526-v2-section-8-direct-deposit-information-validation/main/main June 5, 2023 11:40 Inactive
@rockwellwindsor-va rockwellwindsor-va merged commit 3220939 into master Jun 5, 2023
@rockwellwindsor-va rockwellwindsor-va deleted the API-24835-526-v2-section-8-direct-deposit-information-validation branch June 5, 2023 12:20
ryan-mcneil pushed a commit that referenced this pull request Dec 11, 2023
)

* RSpec stes written and validation methods added, waiting on some feedback on questions to continue

* Updates schema for discussion in stand up

* Updates and validation, leaving in place until standup discussion

* Adds direct deposit validation - section 8
API-24835
* Adds validataion for direct deposit elements
* Updates 526.json schema file and related files to ensure correct validations
* Updates rswag docs with update schema
* Adds RSpec tests for validations
Changes to be committed:
	modified:   modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb
	modified:   modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json
	modified:   modules/claims_api/config/schemas/v2/526.json
	modified:   modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/example.json
	modified:   modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/request.json
	modified:   modules/claims_api/spec/fixtures/v2/veterans/disability_compensation/form_526_json_api.json
	modified:   modules/claims_api/spec/requests/v2/veterans/disability_compensation_request_spec.rb
	modified:   spec/support/schemas/claims_api/v2/forms/disability/submission.json

* Fixing my Gemfile.lock include

* Rollbacks incorrect inclusions when fixing merge conflict

* Merges master, tests running green, ran swager compile

* Refactors validation file, strengthens tests up

* Fixes strings being passed into the error raised

* Updates test value so it matches a valid account number

* Fixes account number REGEX after latest merge test was red, tests green and in original state,updates swagger and all related json files

* Refactoring in validation file to make check more rebust and give better name to deposit error method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants