-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
Nj 97 income eligibility #4941
Conversation
# 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
# Conflicts: # app/lib/efile/nj/nj1040_calculator.rb
Heroku app: https://gyr-review-app-4941-589890dc884a.herokuapp.com/ |
app/controllers/state_file/questions/nj_homeowner_eligibility_controller.rb
Show resolved
Hide resolved
There was a problem hiding this 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/controllers/state_file/questions/nj_homeowner_eligibility_controller.rb
Show resolved
Hide resolved
app/controllers/state_file/questions/nj_homeowner_eligibility_controller.rb
Outdated
Show resolved
Hide resolved
tenant_home_subject_to_property_taxes: "no" | ||
) | ||
} | ||
it "next path is ineligible page" do |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
app/controllers/state_file/questions/nj_homeowner_eligibility_controller.rb
Outdated
Show resolved
Hide resolved
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for humoring me!
@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 |
Link to pivotal/JIRA issue
https://github.com/newjersey/affordability-pm/issues/97
Is PM acceptance required?
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()
andshow?()
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 thatnext_path()
sort of overridesshow?()
, 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 ifproperty_tax_paid
orrent_paid
arenil
, 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?
Zeus many w2s
(video below)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)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)Married filing jointly 15k wages
transfer has an income that is below the $20k minimum for MFJMarried filing separately 15k wages
transfer has an income that is above the $10k minimum for MFSVideos
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