-
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
FYST-791 ID health insurance premium subtraction #4930
Changes from all commits
2ec4ccd
1375b51
7ecd681
b521057
4f96e1b
6492041
8593c52
505d01e
06ddcb7
d7c8575
3487e10
b25597e
da8e760
5f5c401
d7de8f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module StateFile | ||
module Questions | ||
class IdHealthInsurancePremiumController < QuestionsController | ||
include ReturnToReviewConcern | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module StateFile | ||
class IdHealthInsurancePremiumForm < QuestionsForm | ||
set_attributes_for :intake, :has_health_insurance_premium, :health_insurance_paid_amount | ||
|
||
validates :has_health_insurance_premium, inclusion: { in: %w[yes no], message: :blank } | ||
validates :health_insurance_paid_amount, | ||
presence: true, | ||
numericality: { | ||
allow_blank: true, | ||
greater_than_or_equal_to: 0, | ||
message: I18n.t("validators.not_a_number") | ||
}, | ||
if: -> { has_health_insurance_premium == "yes" } | ||
|
||
def save | ||
attributes_to_save = attributes_for(:intake) | ||
attributes_to_save[:health_insurance_paid_amount] = nil if has_health_insurance_premium == "no" | ||
@intake.update!(attributes_to_save) | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,10 @@ def filer_count | |
filing_status_mfj? ? 2 : 1 | ||
end | ||
|
||
def household_count | ||
filer_count + dependents.size | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mike is implementing this on another PR but don't know who will get to merge it first |
||
|
||
def primary | ||
Person.new(self, :primary) | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<% title = t('.title', year: MultiTenantService.statefile.current_tax_year) %> | ||
<% content_for :page_title, title %> | ||
|
||
<% content_for :card do %> | ||
<h1 class="h2"><%= title %></h1> | ||
<p><%= t(".subtitle", count: current_intake.household_count) %></p> | ||
<%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %> | ||
<div class="reveal"> | ||
<p><a href="#" class="reveal__link"><%= t('.what_is_title') %></a></p> | ||
<div class="reveal__content"><%= t('.what_is_content_html') %></div> | ||
</div> | ||
|
||
<div class="reveal"> | ||
<p><a href="#" class="reveal__link"><%= t('.qualifications_title') %></a></p> | ||
<div class="reveal__content"><%= t('.qualifications_content') %></div> | ||
</div> | ||
|
||
<div class="reveal"> | ||
<p><a href="#" class="reveal__link"><%= t('.medicaid_title') %></a></p> | ||
<div class="reveal__content"><%= t('.medicaid_content') %></div> | ||
</div> | ||
|
||
<div class="question-with-follow-up spacing-below-25"> | ||
<div class="question-with-follow-up__question"> | ||
<div class="white-group"> | ||
<%= | ||
f.cfa_radio_set( | ||
:has_health_insurance_premium, | ||
label_text: t('.health_insurance_premium_question', count: current_intake.household_count, year: MultiTenantService.statefile.current_tax_year), | ||
collection: [ | ||
{ value: :yes, label: t("general.affirmative"), input_html: { "data-follow-up": "#sut-field" } }, | ||
{ value: :no, label: t("general.negative") }, | ||
] | ||
) | ||
%> | ||
</div> | ||
</div> | ||
<div class="question-with-follow-up__follow-up" id="sut-field"> | ||
<div class="notice--warning"> | ||
<p><%= t('.do_not_include_notice_html') %></p> | ||
</div> | ||
|
||
<div class="white-group"> | ||
<div class="spacing-below-15"><%= t(".qualifying_amount_help_text", year: MultiTenantService.statefile.current_tax_year) %></div> | ||
<p class="text--help text--small spacing-below-0"><b><%= t(".amount_paid_helper_text", year: MultiTenantService.statefile.current_tax_year) %></b></p> | ||
<%= f.vita_min_money_field(:health_insurance_paid_amount, "", classes: ["form-width--long"]) %> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<% if params[:return_to_review].present? %> | ||
<%= hidden_field_tag "return_to_review", params[:return_to_review] %> | ||
<% end %> | ||
<%= f.continue %> | ||
<% end %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
<%= | ||
f.cfa_radio_set( | ||
:has_unpaid_sales_use_tax, | ||
label_text: t('.unpaid_sales_use_tax_label_html'), | ||
collection: [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this taken out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is not supposed to be a copy above this Yes/No question -- according to figma. I had included the same text twice (text about sales/use amount) & noticed it was different from the figma, so I removed it |
||
{ value: :yes, label: t("general.affirmative"), input_html: { "data-follow-up": "#sut-field" } }, | ||
{ value: :no, label: t("general.negative") }, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddHealthInsurancePremiumColumnsToIdStateFileIntake < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :state_file_id_intakes, :has_health_insurance_premium, :integer, default: 0, null: false | ||
add_column :state_file_id_intakes, :health_insurance_paid_amount, :decimal, precision: 12, scale: 2 | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe StateFile::Questions::IdHealthInsurancePremiumController do | ||
let(:intake) { create :state_file_id_intake } | ||
before do | ||
sign_in intake | ||
end | ||
|
||
describe "#edit" do | ||
render_views | ||
it 'succeeds' do | ||
get :edit | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe "#update" do | ||
# use the return_to_review_concern shared example if the page | ||
# should skip to the review page when the return_to_review param is present | ||
# requires form_params to be set with any other required params | ||
it_behaves_like :return_to_review_concern do | ||
let(:form_params) do | ||
{ | ||
state_file_id_health_insurance_premium_form: { | ||
has_health_insurance_premium: "yes", | ||
health_insurance_paid_amount: "123" | ||
} | ||
} | ||
end | ||
end | ||
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.
open question whether we should allow
0
value for this amount, but should be ok to review while I wait on answer from productThere 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.
ok to allow 0 here!
https://codeforamerica.atlassian.net/browse/FYST-791?focusedCommentId=12716
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.
if they answer no for health insurance premium question, should we still be adding 0 for the xml and pdf?
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 i'll ask this