Browse Source

Add pages to subsections (2023) and update content

pull/1912/head
Kat 3 years ago
parent
commit
4fe135286d
  1. 9
      app/models/form/lettings/pages/pscharge_value_check.rb
  2. 9
      app/models/form/lettings/pages/scharge_value_check.rb
  3. 9
      app/models/form/lettings/pages/supcharg_value_check.rb
  4. 1
      app/models/form/lettings/questions/pscharge_value_check.rb
  5. 1
      app/models/form/lettings/questions/scharge_value_check.rb
  6. 1
      app/models/form/lettings/questions/supcharg_value_check.rb
  7. 3
      app/models/form/lettings/subsections/income_and_benefits.rb
  8. 12
      config/locales/en.yml
  9. 3
      spec/models/form/lettings/subsections/income_and_benefits_spec.rb

9
app/models/form/lettings/pages/pscharge_value_check.rb

@ -4,9 +4,14 @@ class Form::Lettings::Pages::PschargeValueCheck < ::Form::Page
@id = "pscharge_value_check"
@depends_on = [{ "pscharge_over_soft_max?" => true }]
@title_text = {
"translation" => "soft_validations.pscharge.title_text",
"translation" => "soft_validations.pscharge.over_soft_max_title",
"arguments" => [{
"key" => "pscharge",
"label" => true,
"i18n_template" => "pscharge",
}],
}
@informative_text = ""
@informative_text = I18n.t("soft_validations.charges.informative_text")
end
def questions

9
app/models/form/lettings/pages/scharge_value_check.rb

@ -4,9 +4,14 @@ class Form::Lettings::Pages::SchargeValueCheck < ::Form::Page
@id = "scharge_value_check"
@depends_on = [{ "scharge_over_soft_max?" => true }]
@title_text = {
"translation" => "soft_validations.scharge.title_text",
"translation" => "soft_validations.scharge.over_soft_max_title",
"arguments" => [{
"key" => "scharge",
"label" => true,
"i18n_template" => "scharge",
}],
}
@informative_text = ""
@informative_text = I18n.t("soft_validations.charges.informative_text")
end
def questions

9
app/models/form/lettings/pages/supcharg_value_check.rb

@ -4,9 +4,14 @@ class Form::Lettings::Pages::SupchargValueCheck < ::Form::Page
@id = "supcharg_value_check"
@depends_on = [{ "supcharg_over_soft_max?" => true }]
@title_text = {
"translation" => "soft_validations.supcharg.title_text",
"translation" => "soft_validations.supcharg.over_soft_max_title",
"arguments" => [{
"key" => "supcharg",
"label" => true,
"i18n_template" => "supcharg",
}],
}
@informative_text = ""
@informative_text = I18n.t("soft_validations.charges.informative_text")
end
def questions

1
app/models/form/lettings/questions/pscharge_value_check.rb

@ -8,6 +8,7 @@ class Form::Lettings::Questions::PschargeValueCheck < ::Form::Question
@check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] }
@hint_text = I18n.t("soft_validations.charges.hint_text")
end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze

1
app/models/form/lettings/questions/scharge_value_check.rb

@ -8,6 +8,7 @@ class Form::Lettings::Questions::SchargeValueCheck < ::Form::Question
@check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] }
@hint_text = I18n.t("soft_validations.charges.hint_text")
end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze

1
app/models/form/lettings/questions/supcharg_value_check.rb

@ -8,6 +8,7 @@ class Form::Lettings::Questions::SupchargValueCheck < ::Form::Question
@check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "supcharg_value_check" => 0 }, { "supcharg_value_check" => 1 }] }
@hint_text = I18n.t("soft_validations.charges.hint_text")
end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze

3
app/models/form/lettings/subsections/income_and_benefits.rb

@ -26,6 +26,9 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection
Form::Lettings::Pages::RentMonthly.new(nil, nil, self),
Form::Lettings::Pages::MinRentValueCheck.new("brent_min_rent_value_check", nil, self, check_answers_card_number: 0),
Form::Lettings::Pages::MaxRentValueCheck.new("brent_max_rent_value_check", nil, self, check_answers_card_number: 0),
Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Outstanding.new(nil, nil, self),
Form::Lettings::Pages::OutstandingAmount.new(nil, nil, self),
].compact

12
config/locales/en.yml

@ -369,7 +369,7 @@ en:
less_than_shortfall: "Enter an amount that is more than the shortfall in basic rent"
scharge:
private_registered_provider:
general_needs: "Enter a value for the service charge between £0 and £88 per week if the landlord is a private registered provider and it is a general needs letting"
general_needs: "Enter a value for the service charge between £0 and £800 per week if the landlord is a private registered provider and it is a general needs letting"
supported_housing: "Enter a value for the service charge between £0 and £800 per week if the landlord is a private registered provider and it is a supported housing letting"
local_authority:
general_needs: "Enter a value for the service charge between £0 and £500 per week if the landlord is a local authority and it is a general needs letting"
@ -709,6 +709,16 @@ Make sure these answers are correct."
referral:
title_text: "Are you sure?"
hint_text: "This is a general needs log, and this referral type is for supported housing."
scharge:
over_soft_max_title: "You told us the service charge is %{scharge}"
pscharge:
over_soft_max_title: "You told us the personal service charge is %{pscharge}"
supcharg:
over_soft_max_title: "You told us the support charge is %{supcharg}"
charges:
informative_text: "This is higher than we would expect."
hint_text: "Check the following:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the needs type</li></ul>"
devise:
email:

3
spec/models/form/lettings/subsections/income_and_benefits_spec.rb

@ -32,6 +32,9 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do
rent_monthly
brent_min_rent_value_check
brent_max_rent_value_check
scharge_value_check
pscharge_value_check
supcharg_value_check
outstanding
outstanding_amount
],

Loading…
Cancel
Save