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-1041 ID form 40 add some lines #4985

Merged

Conversation

jenny-heath
Copy link
Contributor

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?

  • Adds lines 12a-c, 15-17, 19-21 to form ID40
  • Some lines are only present on the PDF but not the XML
  • Some lines are pulled directly from DF so don't have calculator methods

How to test?

  • idk if there's much that's not self-explanatory here

Comment on lines 96 to 102
WKSHT_LINE_2_AMTS = {
single: 4673,
married_filing_separately: 4673,
married_filing_jointly: 9346,
head_of_household: 9346,
qualifying_widow: 9346,
}.freeze
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this looks kind of stupid but it's much nicer to access? idk

Copy link
Member

Choose a reason for hiding this comment

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

seems ok to me, we do this elsewhere and I like that's close to where it is used

Comment on lines +126 to +133
def cell_phone_number=(value)
write_df_xml_value(__method__, value)
end

def tax_payer_email=(value)
write_df_xml_value(__method__, value)
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added these so i could test that the list of attrs in the test also have setters (see direct_file_data_spec)

Copy link

Heroku app: https://gyr-review-app-4985-77686ab9448c.herokuapp.com/
View logs: heroku logs --app gyr-review-app-4985 (optionally add --tail)

@@ -107,29 +170,12 @@
end

context "PermanentBuildingFund" do
context "when a client is not blind has filing requirements and does not receive public assistance" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we didn't need to test this again, it's already tested in the calculator spec

Comment on lines +70 to +89
describe "#is_primary_blind?" do
it "returns true when value is X" do
expect(direct_file_data.is_primary_blind?).to eq true
end

it "returns false when node absent" do
xml.at('PrimaryBlindInd').remove
expect(direct_file_data.is_primary_blind?).to eq false
end
end

describe "#is_spouse_blind?" do
it "returns true when value is X" do
expect(direct_file_data.is_spouse_blind?).to eq true
end

it "returns false when node absent" do
xml.at('SpouseBlindInd').remove
expect(direct_file_data.is_spouse_blind?).to eq false
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these methods had been added but not tested

Copy link
Member

@mpidcock mpidcock left a comment

Choose a reason for hiding this comment

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

Looks good + love to see the related cleanup and test improvements, just some minor comments

Comment on lines 96 to 102
WKSHT_LINE_2_AMTS = {
single: 4673,
married_filing_separately: 4673,
married_filing_jointly: 9346,
head_of_household: 9346,
qualifying_widow: 9346,
}.freeze
Copy link
Member

Choose a reason for hiding this comment

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

seems ok to me, we do this elsewhere and I like that's close to where it is used

[line_or_zero(:ID40_LINE_11) - @direct_file_data.total_itemized_or_standard_deduction_amount, 0].max
end

WKSHT_LINE_2_AMTS = {
Copy link
Member

Choose a reason for hiding this comment

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

[dustiest dust] would you mind using WK as an abbreviation for worksheet? I doubt we're at all consistent about it, but it's what I saw somewhere else and am using it in the story I'm working on. also my brain is auto populating a different vowel sound in WKSHT.....

Comment on lines +55 to +56
'TxCompL20' => round_amount_to_nearest_integer(@xml_document.at('StateIncomeTax')&.text),
'L21' => round_amount_to_nearest_integer(@xml_document.at('StateIncomeTax')&.text),
Copy link
Member

Choose a reason for hiding this comment

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

[dust] instead of round_amount_to_nearest_integer could you remove the .text for these and round them? I'm also surprised to see these being rounded in the pdf rather than in the xml or the calculator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, so .text isn't converting it to a string, it's getting the contexts of the xml element, which is what's returned from @xml_document.at('<node name>)`. i'm not sure there is a way to get it out as a number, or at least i haven't seen one?

re: rounding, the xml accepts cents for this field (AmountType) but the pdf wants a whole number

Copy link
Member

Choose a reason for hiding this comment

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

that's the first I've heard of xml wanting/accepting cents but sometimes I guess I have to accept that things are just weird

@jenny-heath jenny-heath merged commit 973e230 into main Nov 20, 2024
7 checks passed
@jenny-heath jenny-heath deleted the FYST-1041-implement-id-form-40-xml-pdf-tax-computation branch November 20, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants