Skip to content

Fyst 1720 md disqualify dependent taxpayers from claiming poverty level credit #5483

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

Conversation

mrotondo
Copy link
Contributor

@mrotondo mrotondo commented Jan 30, 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?

  • The MD 502 calculator is supposed to make certain decisions based on whether the filer will use the filing status "dependent" on their Maryland return. However, this filing status only exists for Maryland, and will never be present on the federal return - we decide whether to use it in MD based on whether the filer's direct file data indicates that they are claimed as a dependent.
  • This means that the previous implementation of Md502Calculator#filing_status_dependent? would never return true for a real user, since it checked the intake's filing status (which is their federal filing status) for a value it could never have.
  • This PR changes that method to instead check the direct_file_data.claimed_as_dependent? method, which is the same way we decide to set their MD filing status to "dependent".
  • Several tests started failing when we made this change, since they were incorrectly setting the federal filing status of test data to 6 (dependent) in their setup methods, which it can never be. These methods (MD502 line 22 and line 42) both relate to EIC and now both return if the filer is claimed as a dependent, which from talking with Courtney I believe is correct, but we should double check.
  • I think that we need a subsequent change that will uniformize how we use filing status in the calculators. It sounds like we calculate a state filing status that could differ from the federal filing status in at least one other state. IMO we should have a federal_filing_status and state_filing_status method on intakes, the latter of which in MD would return dependent if the filer is claimed as a dependent (as we do in Md502.rb on lines 63-74), and switch our calculators over to use #state_filing_status everywhere (or almost everywhere, if there are calculations that explicitly use federal filing status)
    • Notably, there are still a number of tests for Md502Calculator that pass :dependent as a filing status to the StateFileMdIntake constructor, which I believe will never happen in real usage since that is not a valid federal filing status.

How to test?

  • We need to be careful with this one, since we failed to catch this bug in acceptance previously.
  • We should reproduce the error on demo with a persona that is claimed as a dependent but has a valid federal filing status and is otherwise eligible for poverty level credit (and EIC, since i suspect we had the same kind of bug with that credit)
  • We should then use the same persona and do the same checks on this PR's heroku instance and verify that we are not able to claim those credits

wip

Unverified

This user has not yet uploaded their public signing key.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
… and not a federal filing status, and fix calculator tests and implementation accordingly
Copy link

Heroku app: https://gyr-review-app-5483-81eb6cd9fb32.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5483 (optionally add --tail)

before do
allow_any_instance_of(described_class).to receive(:deduction_method_is_standard?).and_return(false)
end
let(:line_1b) { 5_000 }
Copy link
Contributor Author

@mrotondo mrotondo Jan 30, 2025

Choose a reason for hiding this comment

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

These needed to change because the previous values made the intake ineligible for the credit - the test still passed even when I changed the filing status to not-dependent

let(:filing_status) { "dependent" }
let(:line_1b) { 20_000 }
let(:line_7) { 15_000 }
let(:line_1b) { 5_000 }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above

…calculator filing_status_dependent? to indicate that it is MD specific, and fix test for 502CR calculator to accurately represent a persona whose MD filing status will be dependent
@arinchoi03
Copy link
Contributor

arinchoi03 commented Jan 30, 2025

Notably, there are still a number of tests for Md502Calculator that pass :dependent as a filing status to the StateFileMdIntake constructor, which I believe will never happen in real usage since that is not a valid federal filing status.

I'm guessing you're referring to the bunch of tests that do something like this:

      {
        single: 14_600,
        dependent: 14_600,
        married_filing_jointly: 29_200,
        married_filing_separately: 14_600,
        head_of_household: 21_900,
        qualifying_widow: 29_200
      }.each do |filing_status, filing_minimum|
        context "#{filing_status}" do
          let(:intake) { create(:state_file_md_intake, primary_birth_date: primary_birth_date, spouse_birth_date: spouse_birth_date, filing_status: filing_status) }

should we fix this up as a fast follow up to this story? Are we not testing these scenarios properly currently because dependent filing_status doesn't really mean anything -- for instance, we're never entering the if statement here in the test when we determine deduction method?:

      def calculate_deduction_method
        gross_income_amount = if @direct_file_data.claimed_as_dependent?
                                (@direct_file_data.fed_agi + line_or_zero(:MD502_LINE_6)) - line_or_zero(:MD502_LINE_15)
                              else
                                (@direct_file_data.fed_agi - @direct_file_data.fed_taxable_ssb) + line_or_zero(:MD502_LINE_6)
                              end

@@ -1018,30 +1024,31 @@
end

describe "#calculate_line_23" do
let (:deduction_method_standard) { true}
Copy link
Contributor

Choose a reason for hiding this comment

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

space after true

else
let(:filing_status) { filing_status }
let(:claimed_as_dependent) { false }
end
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm guessing we'll do something similar for the MD502 calculator tests when we have time to fix them up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's my thinking

@mrotondo
Copy link
Contributor Author

should we fix this up as a fast follow up to this story? Are we not testing these scenarios properly currently because dependent filing_status doesn't really mean anything -- for instance, we're never entering the if statement here in the test when we determine deduction method?:

Yes, the tests should be fixed but IMO that should go hand in hand with changing how we check filing status (e.g. the federal_filing_status vs state_filing_status suggestion in the pr description). And that work should be very hand in hand with program & PM to make sure it is acceptance-tested really precisely.

And as for the if block you pasted - we will go into that one because that (direct_file_data.claimed_as_dependent?) is actually the correct check (rather than intake.filing_status == :dependent), but I'd rather that the method do something like intake.state_filing_status == :dependent so that we're not duplicating the logic of checking the direct file data field all over the place.

@mrotondo mrotondo merged commit d329ee8 into main Jan 31, 2025
7 checks passed
@mrotondo mrotondo deleted the FYST-1720-md-disqualify-dependent-taxpayers-from-claiming-poverty-level-credit branch January 31, 2025 17:14
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.

None yet

2 participants