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 996 add two income sub md #4945

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

squanto
Copy link
Contributor

@squanto squanto commented Nov 4, 2024

Link to pivotal/JIRA issue

https://codeforamerica.atlassian.net/browse/FYST-996

Is PM acceptance required? (delete one)

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

What was done?

  • add a two income subtractions form to maryland intakes
  • add columns to capture primary and spouse deduction amounts

How to test?

  • go through the maryland flow for creating an intake
  • when selecting a payload to import, select one with a fed student loan amount, like "zeuse many w2's"
  • Verify
  • Risk Assessment
  • n/a

Screenshots (for visual changes)

Screenshot 2024-11-04 at 4 16 18 PM

Copy link

github-actions bot commented Nov 4, 2024

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

Copy link
Contributor

@arinchoi03 arinchoi03 left a comment

Choose a reason for hiding this comment

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

can we add some feature spec expectations in the spec/features/state_file/complete_intake_spec.rb for the MD context?
happy to chat through the comments as well.

Also if you end up changing the migration, you may have to close & reopen the PR to re-create the heroku env with the migration from scratch!

@@ -31,6 +31,7 @@ class StateFileMdQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio
Navigation::NavigationStep.new(StateFile::Questions::MdCountyController),
Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false),
Navigation::NavigationStep.new(StateFile::Questions::IncomeReviewController),
Navigation::NavigationStep.new(StateFile::Questions::MdTwoIncomeSubtractionsController),
Copy link
Contributor

Choose a reason for hiding this comment

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

It says Updated: Page displays right before ID page in the Jira ticket, has this been updated to move before the UnemploymentController? Maybe we can ask if this comes before or after the unemployment controller?

Copy link
Contributor Author

@squanto squanto Nov 6, 2024

Choose a reason for hiding this comment

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

ah yes, just double checked with the ticket author Erica and this should go after the unemployment controller, updated 👍

@@ -0,0 +1,6 @@
class AddStudentLoanInterestDedAmountToStateFileMdIntakes < ActiveRecord::Migration[7.1]
def change
add_column :state_file_md_intakes, :student_loan_interest_ded_amount_cents, :bigint, default: 0, null: false
Copy link
Contributor

Choose a reason for hiding this comment

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

can we call this primary_student_loan_interest_ded_amount
also spouse_student_loan_interest_ded_amount (remove _cents for both)

can we also make this a decimal column like all our other _amount or _amt fields?

ex:

    add_column :state_file_az_intakes, :charitable_cash_amount, :decimal, precision: 12, scale: 2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated this column, and added a feature spec context for mfj to include this added two income sub form 👍

@squanto squanto force-pushed the FYST-996-add-two-income-sub-md branch from f5cca25 to dff5726 Compare November 6, 2024 23:57
squanto and others added 2 commits November 7, 2024 11:33
Co-authored-by: Mike Rotondo <[email protected]>
Co-authored-by: Mike Rotondo <[email protected]>
@squanto
Copy link
Contributor Author

squanto commented Nov 7, 2024

note - seeing a few failing specs on circleci that pass locally (run)


  1) StateFile::MdPermanentAddressForm#save they say yes (mailing address is confirmed as permanent address) saves imported_permanent_address_confirmed as true
     Failure/Error: expect(intake.confirmed_permanent_address).to eq "yes"
     
       expected: "yes"
            got: 0
     
       (compared using ==)
     # ./spec/forms/state_file/md_permanent_address_form_spec.rb:195:in `block (4 levels) in <main>'
     # ./spec/support/locale.rb:4:in `block (2 levels) in <main>'

  2) StateFile::MdPermanentAddressForm#save they say yes (mailing address is confirmed as permanent address) intake already has permanent address fields saved overwrites with address fields from 1040
     Failure/Error: expect(intake.confirmed_permanent_address).to eq "yes"
     
       expected: "yes"
            got: 0
     
       (compared using ==)
     # ./spec/forms/state_file/md_permanent_address_form_spec.rb:214:in `block (5 levels) in <main>'
     # ./spec/support/locale.rb:4:in `block (2 levels) in <main>'

  3) StateFile::MdPermanentAddressForm#save they say no (mailing address not the same as permanent address) saves imported_permanent_address_confirmed as true
     Failure/Error: expect(intake.confirmed_permanent_address).to eq "no"
     
       expected: "no"
            got: 0
     
       (compared using ==)
     # ./spec/forms/state_file/md_permanent_address_form_spec.rb:243:in `block (4 levels) in <main>'
     # ./spec/support/locale.rb:4:in `block (2 levels) in <main>'

Finished in 1.09 seconds (files took 6.72 seconds to load)
3 examples, 3 failures

Failed examples:

rspec ./spec/forms/state_file/md_permanent_address_form_spec.rb:191 # StateFile::MdPermanentAddressForm#save they say yes (mailing address is confirmed as permanent address) saves imported_permanent_address_confirmed as true
rspec ./spec/forms/state_file/md_permanent_address_form_spec.rb:210 # StateFile::MdPermanentAddressForm#save they say yes (mailing address is confirmed as permanent address) intake already has permanent address fields saved overwrites with address fields from 1040
rspec ./spec/forms/state_file/md_permanent_address_form_spec.rb:238 # StateFile::MdPermanentAddressForm#save they say no (mailing address not the same as permanent address) saves imported_permanent_address_confirmed as true


3 examples, 3 failures

Took 10 seconds
Tests Failed

rerunning

@squanto squanto force-pushed the FYST-996-add-two-income-sub-md branch from 8f9b876 to 5b82d6d Compare November 7, 2024 20:21
@squanto squanto force-pushed the FYST-996-add-two-income-sub-md branch from 5b82d6d to aea0918 Compare November 7, 2024 20:53
Copy link
Contributor

@arinchoi03 arinchoi03 left a comment

Choose a reason for hiding this comment

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

a few more comments but I swear we're nearly there! up to pair on these too if you want :)


def valid_amounts
if @intake.direct_file_data.fed_student_loan_interest.present?
if (primary_student_loan_interest_ded_amount.to_i + spouse_student_loan_interest_ded_amount.to_i) != @intake.direct_file_data.fed_student_loan_interest.to_i
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I see a potential problem here:

primary: 20.75 + spouse: 20.75 = total loan interest: 41.50
use .to_i for each value:
20 + 20 = 41

therefore the sum will never be equal. I guess fed_student_loan_interest is always an integer (according to the xsd) so maybe we'll never be in this situation?

I think we should sum the value without converting to_i, then convert to an integer (preferably round?) and make sure they're equal? what do you think?

(primary_student_loan_interest_ded_amount + spouse_student_loan_interest_ded_amount).round != @intake.direct_file_data.fed_student_loan_interest

Copy link
Contributor

Choose a reason for hiding this comment

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

also could we add a spec for this validation?

expect(page).to have_text I18n.t('state_file.questions.terms_and_conditions.edit.title')
click_on I18n.t("state_file.questions.terms_and_conditions.edit.accept")

step_through_df_data_transfer("Transfer Zeus two w2s")
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to use Transfer Zeus two w2s for the fixture in the existing spec?

@@ -191,6 +191,7 @@
it "saves imported_permanent_address_confirmed as true" do
expect(form.valid?).to eq true
form.save
intake.reload
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm why did we need to update this in this PR?

Copy link
Contributor

@arinchoi03 arinchoi03 Nov 7, 2024

Choose a reason for hiding this comment

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

oh is it b/c of this? #4945 (comment) that's so odd. Did you double check running these specs locally on main branch?

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