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

Do not attempt to fill out account holder names if taxes are owed (ac… #5443

Conversation

arinchoi03
Copy link
Contributor

@arinchoi03 arinchoi03 commented Jan 24, 2025

Link to pivotal/JIRA issue

Is PM acceptance required? (delete one)

  • Yes - don't merge until JIRA issue is accepted!

Reminder: merge main into this branch and get green tests before merging to main

What was done?

  • For the 502xml, NameOnBankAccount is only filled out if: if @intake.payment_or_deposit_type.to_sym == :direct_deposit && @intake.refund_or_owe_taxes_type == :refund
  • this logic was not duplicated for the filling out of the PDF:
    • See code:
     def full_names_of_bank_account_holders
          intake = @submission.data_source
          return nil unless intake.payment_or_deposit_type.to_sym == :direct_deposit
    

How to test?

  • Describe the testing approach taken to verify the changes, including:
    • added a test to catch this bug
    • manually loaded a owed MD intake and loaded up the pdf
    • Use Nellie, choose direct_deposit at the taxes-owed controller, and hit download state return
    • confirmed in demo this was an error; confirmed on heroku that this no longer occurs
Screenshot 2025-01-24 at 12 40 43 PM Screenshot 2025-01-24 at 12 40 38 PM

…count holder info is only provided if refund)
@@ -191,6 +191,8 @@ def account_holder_full_name(for_joint: false)
attributes = %w[FirstName MiddleInitial LastName NameSuffix]
account_holder_xmls = @xml_document.css('Form502 NameOnBankAccount')
account_holder_xml = for_joint ? account_holder_xmls[1] : account_holder_xmls[0]
return if account_holder_xml.nil?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

guarding in case the NameOnBankAccount is for some reason nil when we actually do expect it so it doesn't crash

Copy link

Heroku app: https://gyr-review-app-5443-b6462cba189a.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5443 (optionally add --tail)

Copy link
Contributor

@mrotondo mrotondo left a comment

Choose a reason for hiding this comment

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

Nice catch!

…undefined-method-at-for-nil-nil-class-no-method-error
@arinchoi03 arinchoi03 merged commit 0d90b7e into main Jan 24, 2025
7 checks passed
@arinchoi03 arinchoi03 deleted the FYST-1695-no-method-error-undefined-method-at-for-nil-nil-class-no-method-error branch January 24, 2025 22:09
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.

2 participants