-
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 125 income editing #5288
base: main
Are you sure you want to change the base?
Nj 125 income editing #5288
Conversation
@jachan @mmazanec22 this is ready for review again! |
EDIT: Addressed now! |
EDIT: Addressed now! |
the two boulders have been addressed! |
# Conflicts: # app/services/state_file/state_information_service.rb
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.
looks good, also tested MD box 14 to see if anything changed - tahsina
@@ -9,6 +9,7 @@ def edit | |||
|
|||
def update | |||
@w2.assign_attributes(form_params) | |||
@w2.check_box14_limits = true |
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.
note from review: can we turn on this flag in one place when the import is done?
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.
@mmazanec22 I did manage to try out an after_create
callback on the W2 model to toggle check_box14_limits
just after creation, which does allow import... but it's a bit of a challenge to get it to stay set, I think because the controllers re-fetch them from the database when the forms load. So I think I'd either need to
1- find a way to pass the w2 model instances from one place to another instead of loading from DB
2- add a db column for this and set it
3- keep how i have it, setting in each controller each time
I think the second option is good but is not so much better that I want to add it to this PR.
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.
That seems reasonable!
end | ||
|
||
def line_59_spouse | ||
if @intake.filing_status_mfj? | ||
get_personal_excess(@intake.spouse.ssn, :box14_ui_wf_swf, EXCESS_UI_WF_SWF_MAX) + | ||
get_personal_excess(@intake.spouse.ssn, :box14_ui_hc_wd, EXCESS_UI_WF_SWF_MAX) | ||
get_personal_excess(@intake.spouse.ssn, :box14_ui_wf_swf, EXCESS_UI_WF_SWF_MAX) |
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.
review comment: instead of passing excess type, could just pass the value itself
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.
@mmazanec22 actually, i looked at this again and because get_excess_value()
is called within two different iterators (ie needs to look at several w2s), it actually makes that function not so easy to get rid of...
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.
Maybe we add this to the follow up ticket as a "take a look at this"? I don't fully understand why we can't pass in get_box14_ui_overwrite
instead of the field name here
if value.present? && value > limit | ||
errors.add(field, I18n.t("validators.dollar_limit", limit: '%.2f' % limit)) | ||
end | ||
end |
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.
review comment: check if it would be cleaner to put this in the NJ-specific W2
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.
@mmazanec22 it looks like we don't actually have an NJ-specific W2 model yet. we could add one, but i think i will make a follow-up ticket for this
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.
Sorry, meant this comment for the XML builder file. Follow up seems fine to me though
@w2.get_box14_ui_overwrite | ||
else | ||
@w2.send(field_name) | ||
end %> |
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.
review comment: could a method on the W2 model prevent us from having to do all these if-else to get these values?
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.
@mmazanec22 I want to keep this one open too, but since it's only used in a few spots (and in different ways) I think I want to leave as a follow-up in the same ticket as above https://github.com/orgs/newjersey/projects/74/views/1?pane=issue&itemId=92886410&issue=newjersey%7Caffordability-pm%7C241
sum + (w2.box14_ui_hc_wd || 0) + (w2.box14_ui_wf_swf || 0) | ||
end | ||
total.round | ||
w2s.sum { |w2| w2.get_box14_ui_overwrite || 0 }.round |
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.
Nice, more readable
@@ -9,6 +9,7 @@ def edit | |||
|
|||
def update | |||
@w2.assign_attributes(form_params) | |||
@w2.check_box14_limits = true |
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.
That seems reasonable!
if value.present? && value > limit | ||
errors.add(field, I18n.t("validators.dollar_limit", limit: '%.2f' % limit)) | ||
end | ||
end |
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.
Sorry, meant this comment for the XML builder file. Follow up seems fine to me though
end | ||
|
||
def line_59_spouse | ||
if @intake.filing_status_mfj? | ||
get_personal_excess(@intake.spouse.ssn, :box14_ui_wf_swf, EXCESS_UI_WF_SWF_MAX) + | ||
get_personal_excess(@intake.spouse.ssn, :box14_ui_hc_wd, EXCESS_UI_WF_SWF_MAX) | ||
get_personal_excess(@intake.spouse.ssn, :box14_ui_wf_swf, EXCESS_UI_WF_SWF_MAX) |
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.
Maybe we add this to the follow up ticket as a "take a look at this"? I don't fully understand why we can't pass in get_box14_ui_overwrite
instead of the field name here
Link to pivotal/JIRA issue
https://github.com/newjersey/affordability-pm/issues/125
Is PM acceptance required? (delete one)
Reminder: merge main into this branch and get green tests before merging to main
What was done?
UI/WF/SWF
toUIWFSWF
andUIHCWD
UIHCWD
intoUIWFSWF
ifUIWFSWF
is empty... and downstream calculators and XML for NJ1040 and NJ2450 also needed adapting for this.How to test?
Screenshots (for visual changes)
after trying to save values above the limits