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

Nj 97 income eligibility #4941

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

Nj 97 income eligibility #4941

wants to merge 50 commits into from

Conversation

mluedke2
Copy link

@mluedke2 mluedke2 commented Nov 1, 2024

Link to pivotal/JIRA issue

https://github.com/newjersey/affordability-pm/issues/97

Is PM acceptance required?

  • 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?

  • I moved logic that was going to be reused (wage calculation, age check, property tax eligibility) into lib/efile/

  • I edited both next_path() and show?() for several of the property tax-related screens to skip questions not needed due to taxpayer not being eligible for what they were asking. (I learned that next_path() sort of overrides show?(), and had to use both to properly build the flow)

  • I considered adding a line to the calculator (and a bunch of related tests) to make super explicit the requirement 40a, and 41 should be blank. Those lines are blank if property_tax_paid or rent_paid are nil, which is always true when the screens this PR skips are skipped. So in the end it felt over-constrained and would not happen in practice so I removed the extra code. You can see what I removed in this commit if interested.

How to test?

  • The current flow stays the same for everyone with income above the minimum, so that can be still experienced with Zeus many w2s (video below)
  • The Minimal transfer has an income below the minimum, so using that you can see that the user is still asked about being homeowner/tenant but then is moved along (video below)
  • The Blind primary transfer has income below minimum but qualifies for credit-only, so you can see user is asked about homeowner/tenant and the housing details eligibility, but skips the screen asking for property tax/rent paid (video below)
  • The new Married filing jointly 15k wages transfer has an income that is below the $20k minimum for MFJ
  • The new Married filing separately 15k wages transfer has an income that is above the $10k minimum for MFS

Videos

Zeus many w2s

zeus_many_w2s_720.mov

Minimal

minimal_720.mov

Blind primary

blind_primary_720.mov

MFJ $15k Wages (below $20k minimum)

mfj_15k_720.mov

MFS $15k Wages (above $10k minimum)

mfs_15k_720.mov

mluedke2 and others added 30 commits October 25, 2024 14:32
# Conflicts:
#	app/controllers/state_file/questions/nj_homeowner_eligibility_controller.rb
#	app/controllers/state_file/questions/nj_homeowner_property_tax_controller.rb
#	app/controllers/state_file/questions/nj_tenant_eligibility_controller.rb
#	app/controllers/state_file/questions/nj_tenant_rent_paid_controller.rb
#	app/lib/efile/nj/nj1040_calculator.rb
#	spec/lib/efile/nj/nj1040_calculator_spec.rb
…lity

# Conflicts:
#	app/lib/efile/nj/nj1040_calculator.rb
# Conflicts:
#	app/lib/efile/nj/nj1040_calculator.rb
Copy link

github-actions bot commented Nov 1, 2024

Heroku app: https://gyr-review-app-4941-589890dc884a.herokuapp.com/
View logs: heroku logs --app gyr-review-app-4941 (optionally add --tail)

Copy link
Contributor

@jachan jachan left a comment

Choose a reason for hiding this comment

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

Agree with Melanie's comments on naming to avoid NOT_INELIGIBLE, and then have some minor comments on code style. Great work with your first (I think?) PR!

app/lib/efile/nj/nj1040_calculator.rb Outdated Show resolved Hide resolved
app/lib/efile/nj/nj_property_tax_eligibility.rb Outdated Show resolved Hide resolved
app/lib/efile/nj/nj_property_tax_eligibility.rb Outdated Show resolved Hide resolved
app/lib/efile/nj/nj_state_wages.rb Show resolved Hide resolved
tenant_home_subject_to_property_taxes: "no"
)
}
it "next path is ineligible page" do
Copy link
Contributor

Choose a reason for hiding this comment

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

[DUST] Great tests for next path, these are very legible.

@mluedke2 mluedke2 marked this pull request as ready for review November 6, 2024 20:54
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.

[Suggestion] I'm a bit newer to the team so I'm still figuring this out but wondering if all the specific housing-related (NjTenantEligibilityController, NjHomeownerEligibilityController, NjUnsupportedPropertyTaxController) controllers need to be in the StateFileNjQuestionNavigation? This may help with all the logic in the show method -- if that controller is not in the navigation, only time show? will be called if you explicitly navigate to that controller.

case StateFile::NjHomeownerEligibilityHelper.determine_eligibility(current_intake)
when StateFile::NjHomeownerEligibilityHelper::INELIGIBLE
NjIneligiblePropertyTaxController.to_path_helper(options)
when StateFile::NjHomeownerEligibilityHelper::UNSUPPORTED
NjUnsupportedPropertyTaxController.to_path_helper(options)
else
NjHomeownerPropertyTaxController.to_path_helper(options)
if Efile::Nj::NjPropertyTaxEligibility.determine_eligibility(current_intake) == Efile::Nj::NjPropertyTaxEligibility::POSSIBLY_ELIGIBLE_FOR_CREDIT
Copy link
Contributor

@arinchoi03 arinchoi03 Nov 6, 2024

Choose a reason for hiding this comment

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

[dust] would it be cleaner/easier to read if there a way to just call current_intake.possibly_eligible_for_credit? instead of doing comparisons like this everywhere? i.e. define these methods on NJ intake?

Copy link
Author

Choose a reason for hiding this comment

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

Ooh thanks for this suggestion. I don't feel too strongly about having the logic live in the util vs intake model, especially since this is my first PR so there may be a pattern I'm not aware of, but I lean util to keep it separate from everything else.

That being said I'll make the functions like .possibly_eligible_for_credit?(intake) in the util, so it can be

Efile::Nj::NjPropertyTaxEligibility.possibly_eligible_for_deduction_or_credit?(intake)

instead of

Efile::Nj::NjPropertyTaxEligibility.determine_eligibility(intake) == Efile::Nj::NjPropertyTaxEligibility::POSSIBLY_ELIGIBLE_FOR_DEDUCTION_OR_CREDIT

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.

sounds fine to put it in the util

Copy link
Author

Choose a reason for hiding this comment

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

added these in the latest commit

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for humoring me!

@mluedke2
Copy link
Author

mluedke2 commented Nov 7, 2024

@arinchoi03 that is helpful to know that the questions don't all need to be in the Navigation-- our process thus far has been to add all of them to it. I think since this logic is not too tedious I'll keep it, but I'll remember that for next time

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.

6 participants