Browse Source

feat: wip add dynamic text for soft min only

CLDC-1790-sales-validation-content-updates
natdeanlewissoftwire 2 years ago
parent
commit
f089bccf74
  1. 15
      app/models/form/sales/pages/buyer1_income_value_check.rb
  2. 2
      app/models/form/sales/questions/buyer1_income_value_check.rb
  3. 4
      app/models/sales_log.rb
  4. 1
      config/locales/en.yml

15
app/models/form/sales/pages/buyer1_income_value_check.rb

@ -6,6 +6,21 @@ class Form::Sales::Pages::Buyer1IncomeValueCheck < ::Form::Page
"income1_under_soft_min?" => true, "income1_under_soft_min?" => true,
}, },
] ]
@title_text = {
"translation" => "soft_validations.net_income.below_soft_min",
"arguments" => [
{
"key" => "income1",
"label" => true,
"i18n_template" => "income1",
},
{
"key" => "allowed_income_soft_min",
"label" => false,
"i18n_template" => "soft_min",
},
],
}
@informative_text = {} @informative_text = {}
end end

2
app/models/form/sales/questions/buyer1_income_value_check.rb

@ -3,7 +3,7 @@ class Form::Sales::Questions::Buyer1IncomeValueCheck < ::Form::Question
super super
@id = "income1_value_check" @id = "income1_value_check"
@check_answer_label = "Income confirmation" @check_answer_label = "Income confirmation"
@header = "Are you sure this income is correct?" @header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

4
app/models/sales_log.rb

@ -211,4 +211,8 @@ class SalesLog < Log
def old_persons_shared_ownership? def old_persons_shared_ownership?
type == 24 type == 24
end end
def allowed_income_soft_min
ALLOWED_INCOME_RANGES[ecstat1].soft_min
end
end end

1
config/locales/en.yml

@ -434,6 +434,7 @@ en:
message: "Net income is lower than expected based on the lead tenant’s working situation. Are you sure this is correct?" message: "Net income is lower than expected based on the lead tenant’s working situation. Are you sure this is correct?"
in_soft_max_range: in_soft_max_range:
message: "Net income is higher than expected based on the lead tenant’s working situation. Are you sure this is correct?" message: "Net income is higher than expected based on the lead tenant’s working situation. Are you sure this is correct?"
below_soft_min: "You said income was %{income1}, which is below this working situation's minimum (%{soft_min})"
rent: rent:
min: min:
title_text: "You told us the rent is %{brent}" title_text: "You told us the rent is %{brent}"

Loading…
Cancel
Save