Skip to content

Commit

Permalink
fixing for nil values
Browse files Browse the repository at this point in the history
  • Loading branch information
erubinst committed Dec 26, 2024
1 parent d8f498b commit 91ee98d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,17 @@ def construct_coverage_information(insurance_policy, covered_individuals, tax_ho
aptc_tax_credit = insurance_policy.applied_aptc_amount_for(enrollments_for_month, month, tax_household)

slcsp = insurance_policy.fetch_slcsp_premium(enrollments_for_month, month, tax_household, aptc_tax_credit)
total_premium = format('%.2f', (pre_amt_tot.to_f + pediatric_dental_pre))
total_premium = if pre_amt_tot && pediatric_dental_pre
format('%.2f', (pre_amt_tot.to_f + pediatric_dental_pre))
else
nil
end
{
month: Date::MONTHNAMES[month],
coverage_information: {
tax_credit: Money.new((BigDecimal(aptc_tax_credit) * 100).round, 'USD'),
total_premium: Money.new((BigDecimal(total_premium) * 100).round, 'USD'),
slcsp_benchmark_premium: Money.new((BigDecimal(slcsp) * 100).round, 'USD')
tax_credit: aptc_tax_credit ? Money.new((BigDecimal(aptc_tax_credit) * 100).round, 'USD') : nil,
total_premium: total_premium ? Money.new((BigDecimal(total_premium) * 100).round, 'USD'): nil,
slcsp_benchmark_premium: slcsp ? Money.new((BigDecimal(slcsp) * 100).round, 'USD'): nil
}
}
end
Expand Down

0 comments on commit 91ee98d

Please sign in to comment.