Skip to content

Commit

Permalink
reenable test + remove some unneeded mapping logic
Browse files Browse the repository at this point in the history
  • Loading branch information
spompea-cfa committed Feb 26, 2025
1 parent e92122a commit 5ba71c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 63 deletions.
61 changes: 0 additions & 61 deletions app/lib/pdf_filler/f13614c_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ def hash_for_pdf
"form1[0].page1[0].mailingState[0]" => @intake.state&.upcase,
"form1[0].page1[0].mailingZIPCode[0]" => @intake.zip_code,
)
answers.merge!(
yes_no_checkboxes("form1[0].page1[0].q11HaveYouOr[0]", collective_yes_no_unsure(@intake.issued_identity_pin, @intake.spouse_issued_identity_pin))
)

answers.merge!({
"form1[0].page1[0].writtenCommunicationLanguage[0].otherLanguageNo[0]" => @intake.written_language_preference_english? ? '1' : nil,
Expand Down Expand Up @@ -141,26 +138,6 @@ def hash_for_pdf

answers["form1[0].page2[0].receivedMoneyFrom[0].howManyJobs[0]"] = @intake.job_count.to_s

# PAGE 2: INCOME
answers.merge!(
yes_no_checkboxes("form1[0].page2[0].Part3[0].q3Scholarships[0]", @intake.had_scholarships, include_unsure: true),
yes_no_checkboxes("form1[0].page2[0].Part3[0].q8CashCheckPayments[0]", @intake.had_cash_check_digital_assets, include_unsure: true),
yes_no_checkboxes("form1[0].page2[0].Part3[0].q10DisabilityIncome[0]", @intake.had_disability_income, include_unsure: true),

yes_no_checkboxes("form1[0].page2[0].Part4[0].q1Alimony[0]", fetch_gated_value(@intake, :paid_alimony), include_unsure: true),
yes_no_checkboxes("form1[0].page2[0].Part4[0].q1Alimony[0].IfYes[0]", @intake.has_ssn_of_alimony_recipient),
)
answers.merge!(
"form1[0].page2[0].Part4[0].q2Contributions[0].IRA[0]" => yes_no_unfilled_to_checkbox(@intake.contributed_to_ira),
"form1[0].page2[0].Part4[0].q2Contributions[0].RothIRA[0]" => yes_no_unfilled_to_checkbox(@intake.contributed_to_roth_ira),
"form1[0].page2[0].Part4[0].q2Contributions[0]._401K[0]" => yes_no_unfilled_to_checkbox(@intake.contributed_to_401k),
"form1[0].page2[0].Part4[0].q2Contributions[0].Other[0]" => yes_no_unfilled_to_checkbox(@intake.contributed_to_other_retirement_account),
)

answers.merge!(
yes_no_checkboxes("form1[0].page2[0].Part4[0].q3PostSecondary[0]", @intake.paid_post_secondary_educational_expenses, include_unsure: true),
)

# PAGE TWO: right-side certified volunteer section
answers.merge!(
# Wages: W-2s
Expand Down Expand Up @@ -325,19 +302,6 @@ def hash_for_pdf
'form1[0].page3[0].informationReportComment[0].informationReportComment[0]' => @intake.cv_14c_page_3_notes_part_3,
)

answers.merge!(
"form1[0].page2[0].Part5[0].q4HaveEarnedIncome[0].WhichTaxYear[0]" => @intake.tax_credit_disallowed_year
)
answers.merge!(
yes_no_checkboxes("form1[0].page2[0].Part5[0].q6ReceiveTheFirst[0]", fetch_gated_value(@intake, :received_homebuyer_credit), include_unsure: true),
)
answers.merge!(
"form1[0].page2[0].Part5[0].q7MakeEstimatedTax[0].HowMuch[0]" => @intake.made_estimated_tax_payments_amount,
)
answers.merge!(
yes_no_checkboxes("form1[0].page2[0].Part5[0].q8FileAFederal[0]", @intake.had_capital_loss_carryover, include_unsure: true),
)

answers.merge!(
keep_and_normalize(
{
Expand All @@ -347,12 +311,6 @@ def hash_for_pdf
}
)
)
answers.merge!(
yes_no_checkboxes("form1[0].page3[0].q4[0]", @intake.balance_pay_from_bank),
)
answers.merge!(
"form1[0].page3[0].q5[0].IfYesWhere[0]" => @intake.had_disaster_loss_where,
)
answers.merge!(demographic_info) if @intake.demographic_questions_opt_in_yes? || @intake.demographic_questions_hub_edit

# ty2024 page 5
Expand All @@ -361,28 +319,9 @@ def hash_for_pdf

# end - ty2024 page 5

answers.merge!(vita_consent_to_disclose_info) if @intake.client&.consent&.disclose_consented_at
answers
end


def vita_consent_to_disclose_info
# aka form 15080 on page 4 info
return {} unless @intake.primary_consented_to_service_at.present?

data = {
"form1[0].page4[0].primaryTaxpayer[0]" => @intake.primary.first_and_last_name,
"form1[0].page4[0].primarydateSigned[0]" => strftime_date(@intake.primary_consented_to_service_at),
}
if @intake.spouse_consented_to_service_at.present?
data.merge!(
"form1[0].page4[0].secondaryTaxpayer[0]" => @intake.spouse.first_and_last_name,
"form1[0].page4[0].secondaryDateSigned[0]" => strftime_date(@intake.spouse_consented_to_service_at),
)
end
data
end

def you_and_spouse_info
hash = {
# You
Expand Down
3 changes: 1 addition & 2 deletions spec/lib/pdf_filler/f13614c_pdf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@
)
end

# TODO reenable for TY2024
xit "can successfully write everything that comes out of #hash_for_pdf to the PDF" do
it "can successfully write everything that comes out of #hash_for_pdf to the PDF" do
expect(intake_pdf.hash_for_pdf.length).to be > 100 # sanity check
form_fields = PdfForms.new.get_fields(intake_pdf.output_file)

Expand Down

0 comments on commit 5ba71c6

Please sign in to comment.