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

Direct deposit update #12812

Merged
merged 0 commits into from
May 31, 2023
Merged

Direct deposit update #12812

merged 0 commits into from
May 31, 2023

Conversation

tpharrison
Copy link
Contributor

@tpharrison tpharrison commented May 25, 2023

Summary

The core changes are around the Lighthouse::DirectDeposit::Service.update_payment_info method. Any requests to the Lighthouse Direct Deposit API that result in a 400-599 range will throw an exception.

Exceptions will be handled using the Lighthouse::ServiceException class. This class that was made to be a generic exception handler for error objects and requests that come from the Lighthouse API endpoints, taking into account the currently known different "styles" of errors that may come.

The V0::Profile::DirectDeposits::DisabilityCompensationsController uses a rescue_from from block to standardize error responses from the Lighthouse Direct Deposit API and provide an error code that the front end can use more easily.

Testing done

  • Controllers specs
  • Swagger specs

More specs will be added in subsequent PRs.

@va-vsp-bot va-vsp-bot requested a deployment to direct-deposit-update/main/main May 25, 2023 20:27 In progress
@github-actions
Copy link

1 Warning
⚠️ This PR changes 413 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

  • app/controllers/v0/profile/direct_deposits/disability_compensations_controller.rb (+18/-0)

  • lib/common/exceptions/forbidden.rb (+3/-0)

  • lib/common/exceptions/unauthorized.rb (+3/-0)

  • lib/lighthouse/direct_deposit/client.rb (+20/-0)

  • lib/lighthouse/direct_deposit/error_parser.rb (+84/-0)

  • lib/lighthouse/direct_deposit/error_response.rb (+45/-0)

  • lib/lighthouse/service_exception.rb (+6/-1)

  • spec/controllers/v0/profile/direct_deposits/disability_compensations_controller_spec.rb (+189/-13)

  • spec/requests/swagger_spec.rb (+24/-7)

    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 direct-deposit-update/main/main May 25, 2023 20:27 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to direct-deposit-update/main/main May 25, 2023 20:57 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to direct-deposit-update/main/main May 25, 2023 20:57 Inactive
@tpharrison tpharrison marked this pull request as ready for review May 25, 2023 21:06
@tpharrison tpharrison requested review from a team as code owners May 25, 2023 21:06
@@ -73,7 +73,12 @@ def self.get_errors_from_response(error, error_status = nil)
def self.error_object_details(error_body, error_status)
status = error_status&.to_s
title = error_body['title'] || error_class(status.to_sym).to_s
detail = error_body['detail'] || error_body['message'] || error_body['error'] || 'No details provided'
detail = error_body['detail'] ||
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahay-agile6 Just FYI - I added a check for error_description.

@va-vsp-bot va-vsp-bot requested a deployment to direct-deposit-update/main/main May 31, 2023 12:17 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to direct-deposit-update/main/main May 31, 2023 12:18 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to direct-deposit-update/main/main May 31, 2023 15:50 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to direct-deposit-update/main/main May 31, 2023 15:50 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to direct-deposit-update/main/main May 31, 2023 16:40 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to direct-deposit-update/main/main May 31, 2023 16:40 In progress
@tpharrison tpharrison merged commit 2e5fc61 into master May 31, 2023
@tpharrison tpharrison deleted the direct-deposit-update branch May 31, 2023 19:26
ryan-mcneil pushed a commit that referenced this pull request Dec 11, 2023
* Add update function to direct deposit service and standardize error responses

* Linting fixes

---------

Co-authored-by: Jeremy Weiland <jeremy6d@users.noreply.github.com>
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.

4 participants