7 changed files with 67 additions and 2 deletions
@ -0,0 +1,28 @@
|
||||
class Form::Sales::Pages::CombinedIncomeMaxValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, buyer_index:) |
||||
super(id, hsh, subsection) |
||||
@depends_on = [ |
||||
{ |
||||
"combined_income_over_soft_max?" => true, |
||||
}, |
||||
] |
||||
@title_text = { |
||||
"translation" => "soft_validations.income.over_soft_max_for_la_combined", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "field_formatted_as_currency", |
||||
"arguments_for_key" => "combined_income", |
||||
"i18n_template" => "combined_income", |
||||
} |
||||
], |
||||
} |
||||
@informative_text = {} |
||||
@buyer_index = buyer_index |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::CombinedIncomeValueCheck.new(nil, nil, self, buyer_index: @buyer_index), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,25 @@
|
||||
class Form::Sales::Questions::CombinedIncomeValueCheck < ::Form::Question |
||||
def initialize(id, hsh, page, buyer_index:) |
||||
super(id, hsh, page) |
||||
@id = "combined_income_value_check" |
||||
@check_answer_label = "Combined income confirmation" |
||||
@header = "Are you sure this is correct?" |
||||
@type = "interruption_screen" |
||||
@answer_options = { |
||||
"0" => { "value" => "Yes" }, |
||||
"1" => { "value" => "No" }, |
||||
} |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"combined_income_value_check" => 0, |
||||
}, |
||||
{ |
||||
"combined_income_value_check" => 1, |
||||
}, |
||||
], |
||||
} |
||||
@check_answers_card_number = buyer_index |
||||
@page = page |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class AddCombinedIncomeValueCheckToSalesLog < ActiveRecord::Migration[7.0] |
||||
def change |
||||
add_column :sales_logs, :combined_income_value_check, :integer |
||||
end |
||||
end |
||||
Loading…
Reference in new issue