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

FYST-526 Update refund taxes owed UI and add financial information to MD pdf/xml #5007

Conversation

arinchoi03
Copy link
Contributor

@arinchoi03 arinchoi03 commented Nov 19, 2024

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?

  • Removed bank_name from all intakes!
  • Deconstructed account_holder_name for MD, since the XML requires the names separated out
  • Added joint_account_holder_name fields for MD
  • Implemented follow up question component for joint account holder name (see thread for convo if curious)
  • MD xml/pdf information flow through from tax_refund/taxes_owed -- lot of the xml is already filled out via another ticket; see subtasks for specifics needed to be implemented in this ticket

How to test?

  • Describe the testing approach taken to verify the changes, including:
    • Unit/integration/manual tests

Screenshots (for visual changes)

UI

Screenshot 2024-11-22 at 12 53 46 PM

XML

Screenshot 2024-11-24 at 12 14 59 AM Screenshot 2024-11-24 at 12 15 07 AM

PDF

Screenshot 2024-11-24 at 12 15 27 AM

@arinchoi03 arinchoi03 added the wip denotes a work in progress that isn't ready for formal review label Nov 19, 2024
@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch 2 times, most recently from 1a839f1 to 661fa00 Compare November 19, 2024 22:55
@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch from 661fa00 to 9ce7a6e Compare November 21, 2024 17:13
@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch from 32f56e1 to 32d75ff Compare November 21, 2024 17:56
…es-owed-ui-and-add-financial-information-to-md-pdf-xml
Copy link

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

@arinchoi03
Copy link
Contributor Author

arinchoi03 commented Nov 22, 2024

  • persona specs failing & bit mystifying why that is
  • still need to implement validations that match with md schema for these name fields, i just copied over what was in the name dob form at the moment. For example, I think the last name allowing 137 characters is probably not ideal.
  • maybe think about implementing a feature spec where the client toggles on the joint account holder checkbox & fills out info
  • styling for the headers of the account holder names
  • some open questions (1, 2) for Product, if not getting answer by tomorrow, ping Tiffany
  • all the xml/pdf stuff hasn't even been started yet 😓

@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch from 07fffc4 to f0e3644 Compare November 22, 2024 18:49
@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch from f0e3644 to 09d242f Compare November 22, 2024 18:54
validates :account_holder_first_name, presence: true
validates :account_holder_last_name, presence: true
validates :account_holder_first_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,15})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.first_name.invalid_format') }}
validates :account_holder_last_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,31})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.last_name.invalid_format') }}
Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 25, 2024

Choose a reason for hiding this comment

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

ask Tiffany about following schema strictly? (allowing numbers in first/last name)

Tiffany Chang sorry to be super annoying again but on “implement any character-type validations that are present in the schema for this field” for people’s names –

Currently the first and last names have this validation ([A-Za-z0-9'-] ?)*[A-Za-z0-9'-] which means any characters (alphabet, numbers, apostrophes and dash, white space). Do we want the same validation? I’m talking specifically about numbers…do we want to allow numbers here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 26, 2024

Choose a reason for hiding this comment

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

answered!
https://codeforamerica.atlassian.net/browse/FYST-526?focusedCommentId=13486

Arin Choi great catch--let’s allow alphabet, apostrophes and dash, and white space only. no numbers

@@ -0,0 +1,14 @@
class AddJointAccountHolderNameAndAccountHolderDeconstructedFields < ActiveRecord::Migration[7.1]
def change
add_column :state_file_md_intakes, :has_joint_account_holder, :integer, default: 0
Copy link
Contributor

Choose a reason for hiding this comment

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

ack i'm so sorry but we also usually have null: false on the enum columns. forgot to mention in the last comment 😓

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 should've caught that! ty


describe "#calculate_authorize_direct_deposit" do
context "bank authorization was given" do
it "should return X" do
Copy link
Contributor

Choose a reason for hiding this comment

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

minor but it now returns true (same for "nil" below)


context "AuthToDirectDepositInd" do
before do
intake.bank_authorization_confirmed = "yes"
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry if this is a ridiculous question but does this...work? i would usually
intake.update(bank_authorization_confirmed: "yes")

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 26, 2024

Choose a reason for hiding this comment

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

yeahh i'm not sure what's going on but
allow(intake).to receive(:bank_authorization_confirmed_yes?).and_return true and intake.bank_authorization_confirmed = "yes"

passes this spec, but fails with:
intake.bank_authorization_confirmed_yes!
intake.update(bank_authorization_confirmed: "yes")

Even when I put a binding.pry and try to manually update by using intake.update(bank_authorization_confirmed: "yes") it returns unfilled for the value after successful update
I'm super confused...I'm going to go with the mocking of the call bank_authorization_confirmed_yes? to be more stubbed for this spec

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 26, 2024

Choose a reason for hiding this comment

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

I needed to set the payment type in the test so that on save (which happens with update and _yes! methods), if the payment type is not direct_deposit, it will run sanitize_bank_details which was setting it back to "unfilled"

      intake.payment_or_deposit_type = 'direct_deposit'
      intake.update(bank_authorization_confirmed: "yes")

gonna leave the test as-is but just for posterity...

Comment on lines 462 to 465
intake.payment_or_deposit_type = "direct_deposit"
intake.account_holder_first_name = "Jack"
intake.account_holder_middle_initial = "D"
intake.account_holder_last_name = "Hansel"
Copy link
Contributor

Choose a reason for hiding this comment

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

same question. idk if i just completely missed this on the first review sorry

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 26, 2024

Choose a reason for hiding this comment

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

Screenshot 2024-11-25 at 7 39 20 PM

it works, it seems. intake.update() works too -- i can update this one

Copy link
Contributor

@jenny-heath jenny-heath left a comment

Choose a reason for hiding this comment

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

looks pretty good! a couple of minor comments but i don't think they require re-review.

the only other thing, which can be a follow-up to this work because it's just adding ignored columns: will we lose historical data when we remove df_data_import_failed_at altogether? does anyone care?

@arinchoi03
Copy link
Contributor Author

@jenny-heath I think that's a great question about df_data_import_failed_at -- I did create a ticket in the story where I was attempting to ignore it https://codeforamerica.atlassian.net/browse/FYST-1173
We're not really dropping the column yet but I think we should definitely discuss if we should. I'll add a computer gardening topic to follow up on this & potentially create a story if we think we want to drop with note to alert DS :)

@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch from bd8ad7f to 307d579 Compare November 26, 2024 17:59
@arinchoi03 arinchoi03 force-pushed the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch from 307d579 to 8461769 Compare November 26, 2024 18:00
@@ -46,8 +46,8 @@ class MdTaxRefundForm < QuestionsForm
with_options if: -> { has_joint_account_holder == 'yes' } do
validates :joint_account_holder_first_name, presence: true
validates :joint_account_holder_last_name, presence: true
validates :joint_account_holder_first_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,15})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.first_name.invalid_format') }}
validates :joint_account_holder_last_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,137})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.last_name.invalid_format') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rubymine said {1} after the [a-zA-Z] was redundant, so I removed it

@arinchoi03
Copy link
Contributor Author

closing & reopening b/c migrations were changed

@arinchoi03 arinchoi03 closed this Nov 26, 2024
@arinchoi03 arinchoi03 reopened this Nov 26, 2024
Copy link

Heroku app: https://gyr-review-app-5007-3938db5fac03.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5007 (optionally add --tail)

@arinchoi03 arinchoi03 merged commit a074c6d into main Nov 27, 2024
7 checks passed
@arinchoi03 arinchoi03 deleted the FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml branch November 27, 2024 22:10
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.

3 participants