Browse Source

Merge branch 'main' into EquityDecimalPlace

pull/2746/head
Rachael Booth 2 years ago committed by GitHub
parent
commit
ab60a6c4c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      .github/workflows/staging_pipeline.yml
  2. 6
      app/components/create_log_actions_component.html.erb
  3. 6
      app/helpers/filters_helper.rb
  4. 1
      app/helpers/interruption_screen_helper.rb
  5. 2
      app/models/bulk_upload.rb
  6. 4
      app/models/derived_variables/lettings_log_variables.rb
  7. 8
      app/models/derived_variables/sales_log_variables.rb
  8. 6
      app/models/form.rb
  9. 8
      app/models/form/lettings/pages/care_home_charges_value_check.rb
  10. 1
      app/models/form/lettings/pages/care_home_weekly.rb
  11. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb
  12. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb
  13. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb
  14. 21
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb
  15. 22
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb
  16. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb
  17. 2
      app/models/form/lettings/pages/income_amount.rb
  18. 1
      app/models/form/lettings/pages/income_known.rb
  19. 4
      app/models/form/lettings/pages/lead_tenant_nationality.rb
  20. 6
      app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb
  21. 8
      app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb
  22. 8
      app/models/form/lettings/pages/multiple_partners_value_check.rb
  23. 5
      app/models/form/lettings/pages/net_income_value_check.rb
  24. 9
      app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb
  25. 9
      app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb
  26. 9
      app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb
  27. 9
      app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb
  28. 9
      app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb
  29. 9
      app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb
  30. 8
      app/models/form/lettings/pages/partner_under_16_value_check.rb
  31. 6
      app/models/form/lettings/pages/person_over_retirement_value_check.rb
  32. 8
      app/models/form/lettings/pages/person_under_retirement_value_check.rb
  33. 4
      app/models/form/lettings/pages/property_local_authority.rb
  34. 5
      app/models/form/lettings/pages/property_major_repairs_value_check.rb
  35. 8
      app/models/form/lettings/pages/pscharge_value_check.rb
  36. 5
      app/models/form/lettings/pages/reasonother_value_check.rb
  37. 5
      app/models/form/lettings/pages/referral_value_check.rb
  38. 2
      app/models/form/lettings/pages/rent_4_weekly.rb
  39. 2
      app/models/form/lettings/pages/rent_bi_weekly.rb
  40. 2
      app/models/form/lettings/pages/rent_monthly.rb
  41. 5
      app/models/form/lettings/pages/rent_value_check.rb
  42. 2
      app/models/form/lettings/pages/rent_weekly.rb
  43. 8
      app/models/form/lettings/pages/scharge_value_check.rb
  44. 8
      app/models/form/lettings/pages/supcharg_value_check.rb
  45. 4
      app/models/form/lettings/pages/uprn.rb
  46. 5
      app/models/form/lettings/pages/void_date_value_check.rb
  47. 2
      app/models/form/lettings/questions/age.rb
  48. 3
      app/models/form/lettings/questions/benefits.rb
  49. 4
      app/models/form/lettings/questions/brent_4_weekly.rb
  50. 4
      app/models/form/lettings/questions/brent_bi_weekly.rb
  51. 4
      app/models/form/lettings/questions/brent_monthly.rb
  52. 4
      app/models/form/lettings/questions/brent_weekly.rb
  53. 3
      app/models/form/lettings/questions/care_home_charges_value_check.rb
  54. 4
      app/models/form/lettings/questions/chcharge_4_weekly.rb
  55. 4
      app/models/form/lettings/questions/chcharge_bi_weekly.rb
  56. 4
      app/models/form/lettings/questions/chcharge_monthly.rb
  57. 4
      app/models/form/lettings/questions/chcharge_weekly.rb
  58. 6
      app/models/form/lettings/questions/declaration.rb
  59. 4
      app/models/form/lettings/questions/earnings.rb
  60. 2
      app/models/form/lettings/questions/ethnic_white.rb
  61. 4
      app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
  62. 3
      app/models/form/lettings/questions/hb.rb
  63. 3
      app/models/form/lettings/questions/hbrentshortfall.rb
  64. 3
      app/models/form/lettings/questions/household_charge.rb
  65. 2
      app/models/form/lettings/questions/housingneeds_other.rb
  66. 4
      app/models/form/lettings/questions/incfreq.rb
  67. 6
      app/models/form/lettings/questions/is_carehome.rb
  68. 2
      app/models/form/lettings/questions/layear.rb
  69. 2
      app/models/form/lettings/questions/letting_allocation.rb
  70. 3
      app/models/form/lettings/questions/major_repairs_date_value_check.rb
  71. 3
      app/models/form/lettings/questions/multiple_partners_value_check.rb
  72. 3
      app/models/form/lettings/questions/net_income_known.rb
  73. 3
      app/models/form/lettings/questions/net_income_value_check.rb
  74. 3
      app/models/form/lettings/questions/no_retirement_value_check.rb
  75. 3
      app/models/form/lettings/questions/partner_under_16_value_check.rb
  76. 3
      app/models/form/lettings/questions/period.rb
  77. 2
      app/models/form/lettings/questions/person_relationship.rb
  78. 3
      app/models/form/lettings/questions/pregnancy_value_check.rb
  79. 2
      app/models/form/lettings/questions/previous_let_type.rb
  80. 4
      app/models/form/lettings/questions/pscharge_4_weekly.rb
  81. 4
      app/models/form/lettings/questions/pscharge_bi_weekly.rb
  82. 4
      app/models/form/lettings/questions/pscharge_monthly.rb
  83. 4
      app/models/form/lettings/questions/pscharge_value_check.rb
  84. 4
      app/models/form/lettings/questions/pscharge_weekly.rb
  85. 2
      app/models/form/lettings/questions/reason.rb
  86. 2
      app/models/form/lettings/questions/reason_renewal.rb
  87. 3
      app/models/form/lettings/questions/reasonother_value_check.rb
  88. 2
      app/models/form/lettings/questions/referral.rb
  89. 2
      app/models/form/lettings/questions/referral_prp.rb
  90. 2
      app/models/form/lettings/questions/referral_supported_housing.rb
  91. 2
      app/models/form/lettings/questions/referral_supported_housing_prp.rb
  92. 3
      app/models/form/lettings/questions/referral_value_check.rb
  93. 2
      app/models/form/lettings/questions/rent_type.rb
  94. 4
      app/models/form/lettings/questions/rent_value_check.rb
  95. 3
      app/models/form/lettings/questions/retirement_value_check.rb
  96. 2
      app/models/form/lettings/questions/rsnvac.rb
  97. 4
      app/models/form/lettings/questions/scharge_4_weekly.rb
  98. 4
      app/models/form/lettings/questions/scharge_bi_weekly.rb
  99. 4
      app/models/form/lettings/questions/scharge_monthly.rb
  100. 4
      app/models/form/lettings/questions/scharge_value_check.rb
  101. Some files were not shown because too many files have changed in this diff Show More

1
.github/workflows/staging_pipeline.yml

@ -8,6 +8,7 @@ on:
types: types:
- opened - opened
- synchronize - synchronize
merge_group:
workflow_dispatch: workflow_dispatch:
defaults: defaults:

6
app/components/create_log_actions_component.html.erb

@ -1,11 +1,11 @@
<div class="govuk-button-group app-filter-toggle <%= "govuk-!-margin-bottom-6" if display_actions? %>">
<% if display_actions? %> <% if display_actions? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6"> <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %>
<%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-6" %>
<% unless user.support? %> <% unless user.support? %>
<%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %> <%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %>
<% end %> <% end %>
<% if user.support? %> <% if user.support? %>
<%= govuk_button_link_to view_uploads_button_copy, view_uploads_button_href, secondary: true %> <%= govuk_button_link_to view_uploads_button_copy, view_uploads_button_href, secondary: true %>
<% end %> <% end %>
</div>
<% end %> <% end %>
</div>

6
app/helpers/filters_helper.rb

@ -143,7 +143,11 @@ module FiltersHelper
} }
if FormHandler.instance.in_crossover_period? if FormHandler.instance.in_crossover_period?
return years.merge({ archived_collection_start_year.to_s => year_combo(archived_collection_start_year) }) years = years.merge({ archived_collection_start_year.to_s => year_combo(archived_collection_start_year) })
end
if FeatureToggle.allow_future_form_use?
years = { next_collection_start_year.to_s => year_combo(next_collection_start_year) }.merge(years)
end end
years years

1
app/helpers/interruption_screen_helper.rb

@ -1,6 +1,7 @@
module InterruptionScreenHelper module InterruptionScreenHelper
def display_informative_text(informative_text, log) def display_informative_text(informative_text, log)
return informative_text if informative_text.is_a? String return informative_text if informative_text.is_a? String
return "" if informative_text.blank?
return "" unless informative_text["arguments"] return "" unless informative_text["arguments"]
translation_params = {} translation_params = {}

2
app/models/bulk_upload.rb

@ -32,6 +32,8 @@ class BulkUpload < ApplicationRecord
scope :filter_by_user, ->(user_id, _user = nil) { user_id.present? ? where(user_id:) : all } scope :filter_by_user, ->(user_id, _user = nil) { user_id.present? ? where(user_id:) : all }
scope :filter_by_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) } scope :filter_by_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) }
has_paper_trail
def completed? def completed?
incomplete_logs = logs.where.not(status: "completed") incomplete_logs = logs.where.not(status: "completed")
!incomplete_logs.exists? !incomplete_logs.exists?

4
app/models/derived_variables/lettings_log_variables.rb

@ -65,7 +65,7 @@ module DerivedVariables::LettingsLogVariables
self.has_benefits = get_has_benefits self.has_benefits = get_has_benefits
self.tshortfall_known = 0 if tshortfall self.tshortfall_known = 0 if tshortfall
self.nocharge = household_charge&.zero? ? 1 : 0 self.nocharge = household_charge&.zero? ? 1 : 0
if form.start_year_after_2024? && is_bedsit? if form.start_year_2024_or_later? && is_bedsit?
self.beds = 1 self.beds = 1
end end
@ -186,7 +186,7 @@ private
self.wchair = nil self.wchair = nil
self.location_id = nil self.location_id = nil
end end
if form.start_year_after_2024? && (unittype_gn_changed? && unittype_gn_was == 2) if form.start_year_2024_or_later? && (unittype_gn_changed? && unittype_gn_was == 2)
self.beds = nil self.beds = nil
end end
end end

8
app/models/derived_variables/sales_log_variables.rb

@ -29,7 +29,7 @@ module DerivedVariables::SalesLogVariables
end end
end end
if saledate && form.start_year_after_2024? && discounted_ownership_sale? if saledate && form.start_year_2024_or_later? && discounted_ownership_sale?
self.ppostcode_full = postcode_full self.ppostcode_full = postcode_full
self.ppcodenk = pcodenk self.ppcodenk = pcodenk
self.prevloc = la self.prevloc = la
@ -44,7 +44,7 @@ module DerivedVariables::SalesLogVariables
self.hhmemb = number_of_household_members self.hhmemb = number_of_household_members
self.hhtype = household_type self.hhtype = household_type
if saledate && form.start_year_after_2024? if saledate && form.start_year_2024_or_later?
self.soctenant = soctenant_from_prevten_values self.soctenant = soctenant_from_prevten_values
child_under_16_constraints! child_under_16_constraints!
end end
@ -68,6 +68,10 @@ module DerivedVariables::SalesLogVariables
self.la = nil self.la = nil
end end
if form.start_year_2025_or_later? && is_bedsit?
self.beds = 1
end
self.nationality_all = nationality_all_group if nationality_uk_or_prefers_not_to_say? self.nationality_all = nationality_all_group if nationality_uk_or_prefers_not_to_say?
self.nationality_all_buyer2 = nationality_all_buyer2_group if nationality2_uk_or_prefers_not_to_say? self.nationality_all_buyer2 = nationality_all_buyer2_group if nationality2_uk_or_prefers_not_to_say?

6
app/models/form.rb

@ -334,7 +334,11 @@ class Form
type == "sales" || (start_year && start_year.to_i > 2022) type == "sales" || (start_year && start_year.to_i > 2022)
end end
def start_year_after_2024? def start_year_2024_or_later?
start_date && start_date.year >= 2024 start_date && start_date.year >= 2024
end end
def start_year_2025_or_later?
start_date && start_date.year >= 2025
end
end end

8
app/models/form/lettings/pages/care_home_charges_value_check.rb

@ -2,11 +2,15 @@ class Form::Lettings::Pages::CareHomeChargesValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "care_home_charges_value_check" @id = "care_home_charges_value_check"
@copy_key = "lettings.soft_validations.care_home_charges_value_check"
@depends_on = [{ "care_home_charge_expected_not_provided?" => true }] @depends_on = [{ "care_home_charge_expected_not_provided?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.care_home_charges.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
}
@informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
} }
@informative_text = ""
end end
def questions def questions

1
app/models/form/lettings/pages/care_home_weekly.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::CareHomeWeekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "care_home_weekly" @id = "care_home_weekly"
@copy_key = "lettings.income_and_benefits.care_home"
@depends_on = [ @depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => 0 }, { "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => 0 },
{ "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => nil }, { "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => nil },

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValu
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check" @id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembV
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check" @id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCh
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "females_in_soft_age_range_in_pregnant_household_lead_value_check" @id = "females_in_soft_age_range_in_pregnant_household_lead_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

21
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check" @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [ @depends_on = [
{ {
"female_in_pregnant_household_in_soft_validation_range?" => true, "female_in_pregnant_household_in_soft_validation_range?" => true,
@ -9,24 +10,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa
}, },
] ]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
} }
@person_index = person_index @person_index = person_index
end end

22
app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb

@ -2,6 +2,8 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check" @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [ @depends_on = [
{ {
"female_in_pregnant_household_in_soft_validation_range?" => true, "female_in_pregnant_household_in_soft_validation_range?" => true,
@ -9,24 +11,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue
}, },
] ]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
} }
@person_index = person_index @person_index = person_index
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "females_in_soft_age_range_in_pregnant_household_value_check" @id = "females_in_soft_age_range_in_pregnant_household_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

2
app/models/form/lettings/pages/income_amount.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::IncomeAmount < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "income_amount" @id = "income_amount"
@header = "Total household income" @copy_key = "lettings.income_and_benefits.income_amount"
@depends_on = [{ "net_income_known" => 0 }] @depends_on = [{ "net_income_known" => 0 }]
end end

1
app/models/form/lettings/pages/income_known.rb

@ -2,7 +2,6 @@ class Form::Lettings::Pages::IncomeKnown < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "income_known" @id = "income_known"
@header = "Household’s combined income after tax"
end end
def questions def questions

4
app/models/form/lettings/pages/lead_tenant_nationality.rb

@ -2,12 +2,12 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_nationality" @id = "lead_tenant_nationality"
@copy_key = "lettings.household_characteristics.#{form.start_year_after_2024? ? 'nationality_all' : 'national'}" @copy_key = "lettings.household_characteristics.#{form.start_year_2024_or_later? ? 'nationality_all' : 'national'}"
@depends_on = [{ "declaration" => 1 }] @depends_on = [{ "declaration" => 1 }]
end end
def questions def questions
@questions ||= if form.start_year_after_2024? @questions ||= if form.start_year_2024_or_later?
[ [
Form::Lettings::Questions::NationalityAllGroup.new(nil, nil, self), Form::Lettings::Questions::NationalityAllGroup.new(nil, nil, self),
Form::Lettings::Questions::NationalityAll.new(nil, nil, self), Form::Lettings::Questions::NationalityAll.new(nil, nil, self),

6
app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb

@ -2,11 +2,13 @@ class Form::Lettings::Pages::LeadTenantOverRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }] @depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }]
@copy_key = "lettings.soft_validations.retirement_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.max.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.retirement.max.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
} }
end end

8
app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb

@ -2,8 +2,9 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@depends_on = [{ "person_1_retired_under_soft_min_age?" => true }] @depends_on = [{ "person_1_retired_under_soft_min_age?" => true }]
@copy_key = "lettings.soft_validations.no_retirement_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age1", "key" => "age1",
@ -12,7 +13,10 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

8
app/models/form/lettings/pages/multiple_partners_value_check.rb

@ -6,12 +6,16 @@ class Form::Lettings::Pages::MultiplePartnersValueCheck < Form::Page
"multiple_partners?" => true, "multiple_partners?" => true,
}, },
] ]
@copy_key = "lettings.soft_validations.multiple_partners_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.multiple_partners_lettings.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
@informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@informative_text = {}
end end
def questions def questions

5
app/models/form/lettings/pages/net_income_value_check.rb

@ -2,9 +2,10 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "net_income_value_check" @id = "net_income_value_check"
@copy_key = "lettings.soft_validations.net_income_value_check"
@depends_on = [{ "net_income_soft_validation_triggered?" => true }] @depends_on = [{ "net_income_soft_validation_triggered?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.net_income.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "incfreq", "key" => "incfreq",
@ -20,7 +21,7 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.net_income.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [ "arguments" => [
{ {
"key" => "net_income_higher_or_lower_text", "key" => "net_income_higher_or_lower_text",

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck < ::For
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "no_females_pregnant_household_lead_age_value_check" @id = "no_females_pregnant_household_lead_age_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check"
@depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck < ::
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "no_females_pregnant_household_lead_hhmemb_value_check" @id = "no_females_pregnant_household_lead_hhmemb_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check"
@depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck < ::Form::
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "no_females_pregnant_household_lead_value_check" @id = "no_females_pregnant_household_lead_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check"
@depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck < ::F
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "no_females_pregnant_household_person_#{person_index}_age_value_check" @id = "no_females_pregnant_household_person_#{person_index}_age_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check"
@depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }] @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@person_index = person_index @person_index = person_index
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck < ::Form
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "no_females_pregnant_household_person_#{person_index}_value_check" @id = "no_females_pregnant_household_person_#{person_index}_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check"
@depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }] @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@person_index = person_index @person_index = person_index
end end

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

@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "no_females_pregnant_household_value_check" @id = "no_females_pregnant_household_value_check"
@copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check"
@depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], "arguments" => [],
} }
end end

8
app/models/form/lettings/pages/partner_under_16_value_check.rb

@ -6,9 +6,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page
"person_#{person_index}_partner_under_16?" => true, "person_#{person_index}_partner_under_16?" => true,
}, },
] ]
@copy_key = "lettings.soft_validations.partner_under_16_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.partner_under_16_lettings.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age#{person_index}", "key" => "age#{person_index}",
@ -17,7 +18,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

6
app/models/form/lettings/pages/person_over_retirement_value_check.rb

@ -2,11 +2,13 @@ class Form::Lettings::Pages::PersonOverRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }] @depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }]
@copy_key = "lettings.soft_validations.retirement_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.max.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.retirement.max.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
} }
@person_index = person_index @person_index = person_index
end end

8
app/models/form/lettings/pages/person_under_retirement_value_check.rb

@ -2,8 +2,9 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }] @depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }]
@copy_key = "lettings.soft_validations.no_retirement_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age#{person_index}", "key" => "age#{person_index}",
@ -12,7 +13,10 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
@person_index = person_index @person_index = person_index
end end

4
app/models/form/lettings/pages/property_local_authority.rb

@ -3,8 +3,8 @@ class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page
super super
@id = "property_local_authority" @id = "property_local_authority"
@depends_on = [ @depends_on = [
{ "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => false }, { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => false },
{ "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => true, "address_search_given?" => true }, { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => true, "address_search_given?" => true },
] ]
end end

5
app/models/form/lettings/pages/property_major_repairs_value_check.rb

@ -2,10 +2,11 @@ class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "property_major_repairs_value_check" @id = "property_major_repairs_value_check"
@copy_key = "lettings.soft_validations.major_repairs_date_value_check"
@depends_on = [{ "major_repairs_date_in_soft_range?" => true }] @depends_on = [{ "major_repairs_date_in_soft_range?" => true }]
@title_text = { "translation" => "soft_validations.major_repairs_date.title_text" } @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" }
@informative_text = { @informative_text = {
"translation" => "soft_validations.major_repairs_date.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

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

@ -2,16 +2,20 @@ class Form::Lettings::Pages::PschargeValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "pscharge_value_check" @id = "pscharge_value_check"
@copy_key = "lettings.soft_validations.pscharge_value_check"
@depends_on = [{ "pscharge_in_soft_max_range?" => true }] @depends_on = [{ "pscharge_in_soft_max_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.pscharge.over_soft_max_title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "arguments" => [{
"key" => "pscharge", "key" => "pscharge",
"label" => true, "label" => true,
"i18n_template" => "pscharge", "i18n_template" => "pscharge",
}], }],
} }
@informative_text = I18n.t("soft_validations.charges.informative_text") @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

5
app/models/form/lettings/pages/reasonother_value_check.rb

@ -2,13 +2,14 @@ class Form::Lettings::Pages::ReasonotherValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "reasonother_value_check" @id = "reasonother_value_check"
@copy_key = "lettings.soft_validations.reasonother_value_check"
@depends_on = [{ "reasonother_might_be_existing_category?" => true }] @depends_on = [{ "reasonother_might_be_existing_category?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.reasonother.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }], "arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.reasonother.informative_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

5
app/models/form/lettings/pages/referral_value_check.rb

@ -2,12 +2,13 @@ class Form::Lettings::Pages::ReferralValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_value_check" @id = "referral_value_check"
@copy_key = "lettings.soft_validations.referral_value_check"
@depends_on = [{ "la_referral_for_general_needs?" => true }] @depends_on = [{ "la_referral_for_general_needs?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.referral.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.referral.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

2
app/models/form/lettings/pages/rent_4_weekly.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::Rent4Weekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_4_weekly" @id = "rent_4_weekly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "household_charge" => 0, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false }, { "household_charge" => 0, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false },
{ "household_charge" => nil, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false }, { "household_charge" => nil, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false },

2
app/models/form/lettings/pages/rent_bi_weekly.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentBiWeekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_bi_weekly" @id = "rent_bi_weekly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false }, { "household_charge" => nil, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false }, { "household_charge" => 0, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false },

2
app/models/form/lettings/pages/rent_monthly.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentMonthly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_monthly" @id = "rent_monthly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false }, { "household_charge" => nil, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false }, { "household_charge" => 0, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },

5
app/models/form/lettings/pages/rent_value_check.rb

@ -2,8 +2,9 @@ class Form::Lettings::Pages::RentValueCheck < ::Form::Page
def initialize(id, hsh, subsection, check_answers_card_number: nil) def initialize(id, hsh, subsection, check_answers_card_number: nil)
super(id, hsh, subsection) super(id, hsh, subsection)
@depends_on = [{ "rent_soft_validation_triggered?" => true }] @depends_on = [{ "rent_soft_validation_triggered?" => true }]
@copy_key = "lettings.soft_validations.rent_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.rent.outside_range_title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "brent", "key" => "brent",
@ -13,7 +14,7 @@ class Form::Lettings::Pages::RentValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.rent.informative_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [ "arguments" => [
{ {
"key" => "rent_soft_validation_higher_or_lower_text", "key" => "rent_soft_validation_higher_or_lower_text",

2
app/models/form/lettings/pages/rent_weekly.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentWeekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_weekly" @id = "rent_weekly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => 0, "is_carehome?" => false }, { "rent_and_charges_paid_weekly?" => true, "household_charge" => 0, "is_carehome?" => false },
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => nil, "is_carehome?" => false }, { "rent_and_charges_paid_weekly?" => true, "household_charge" => nil, "is_carehome?" => false },

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

@ -2,16 +2,20 @@ class Form::Lettings::Pages::SchargeValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "scharge_value_check" @id = "scharge_value_check"
@copy_key = "lettings.soft_validations.scharge_value_check"
@depends_on = [{ "scharge_in_soft_max_range?" => true }] @depends_on = [{ "scharge_in_soft_max_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.scharge.over_soft_max_title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "arguments" => [{
"key" => "scharge", "key" => "scharge",
"label" => true, "label" => true,
"i18n_template" => "scharge", "i18n_template" => "scharge",
}], }],
} }
@informative_text = I18n.t("soft_validations.charges.informative_text") @title_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

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

@ -2,16 +2,20 @@ class Form::Lettings::Pages::SupchargValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "supcharg_value_check" @id = "supcharg_value_check"
@copy_key = "lettings.soft_validations.supcharg_value_check"
@depends_on = [{ "supcharg_in_soft_max_range?" => true }] @depends_on = [{ "supcharg_in_soft_max_range?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.supcharg.over_soft_max_title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "arguments" => [{
"key" => "supcharg", "key" => "supcharg",
"label" => true, "label" => true,
"i18n_template" => "supcharg", "i18n_template" => "supcharg",
}], }],
} }
@informative_text = I18n.t("soft_validations.charges.informative_text") @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

4
app/models/form/lettings/pages/uprn.rb

@ -14,7 +14,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
end end
def skip_text def skip_text
if form.start_year_after_2024? if form.start_year_2024_or_later?
"Search for address instead" "Search for address instead"
else else
"Enter address instead" "Enter address instead"
@ -24,7 +24,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
def skip_href(log = nil) def skip_href(log = nil)
return unless log return unless log
if form.start_year_after_2024? if form.start_year_2024_or_later?
"address-matcher" "address-matcher"
else else
"address" "address"

5
app/models/form/lettings/pages/void_date_value_check.rb

@ -2,10 +2,11 @@ class Form::Lettings::Pages::VoidDateValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "void_date_value_check" @id = "void_date_value_check"
@copy_key = "lettings.soft_validations.void_date_value_check"
@depends_on = [{ "voiddate_in_soft_range?" => true }] @depends_on = [{ "voiddate_in_soft_range?" => true }]
@title_text = { "translation" => "soft_validations.void_date.title_text" } @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" }
@informative_text = { @informative_text = {
"translation" => "soft_validations.void_date.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

2
app/models/form/lettings/questions/age.rb

@ -27,7 +27,7 @@ class Form::Lettings::Questions::Age < ::Form::Question
end end
def hint_text def hint_text
if form.start_year_after_2024? if form.start_year_2024_or_later?
"Answer 1 for children aged under 1 year old" "Answer 1 for children aged under 1 year old"
end end
end end

3
app/models/form/lettings/questions/benefits.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Benefits < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "benefits" @id = "benefits"
@check_answer_label = "Household income from Universal Credit, state pension or benefits"
@header = "How much of the household’s income is from Universal Credit, state pensions or benefits?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This excludes child and housing benefit, council tax support and tax credits."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/brent_4_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/brent_bi_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/brent_monthly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/brent_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

3
app/models/form/lettings/questions/care_home_charges_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::CareHomeChargesValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "carehome_charges_value_check" @id = "carehome_charges_value_check"
@check_answer_label = "Care home charges confirmation" @copy_key = "lettings.soft_validations.care_home_charges_value_check"
@header = "Are you sure there are no care home charges?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

4
app/models/form/lettings/questions/chcharge_4_weekly.rb

@ -2,12 +2,10 @@ class Form::Lettings::Questions::Chcharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_4_weekly"
@header = "How much does the household pay every 4 weeks?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every 4 weeks" @suffix = " every 4 weeks"

4
app/models/form/lettings/questions/chcharge_bi_weekly.rb

@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_bi_weekly"
@header = "How much does the household pay every 2 weeks?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every 2 weeks" @suffix = " every 2 weeks"

4
app/models/form/lettings/questions/chcharge_monthly.rb

@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_monthly"
@header = "How much does the household pay every month?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every month" @suffix = " every month"

4
app/models/form/lettings/questions/chcharge_weekly.rb

@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_weekly"
@header = "How much does the household pay every week?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every week" @suffix = " every week"

6
app/models/form/lettings/questions/declaration.rb

@ -3,13 +3,13 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
super super
@id = "declaration" @id = "declaration"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 unless form.start_year_after_2024? @check_answers_card_number = 0 unless form.start_year_2024_or_later?
@top_guidance_partial = "privacy_notice_tenant" @top_guidance_partial = "privacy_notice_tenant"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end
def answer_options def answer_options
declaration_text = if form.start_year_after_2024? declaration_text = if form.start_year_2024_or_later?
"The tenant has seen or been given access to the MHCLG privacy notice" "The tenant has seen or been given access to the MHCLG privacy notice"
else else
"The tenant has seen the MHCLG privacy notice" "The tenant has seen the MHCLG privacy notice"
@ -19,7 +19,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
end end
def unanswered_error_message def unanswered_error_message
if form.start_year_after_2024? if form.start_year_2024_or_later?
I18n.t("validations.declaration.missing.post_2024") I18n.t("validations.declaration.missing.post_2024")
else else
I18n.t("validations.declaration.missing.pre_2024") I18n.t("validations.declaration.missing.pre_2024")

4
app/models/form/lettings/questions/earnings.rb

@ -2,14 +2,12 @@ class Form::Lettings::Questions::Earnings < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "earnings" @id = "earnings"
@check_answer_label = "Total household income" @copy_key = "lettings.income_and_benefits.income_amount.earnings"
@header = "How much income does the household have in total?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@top_guidance_partial = "what_counts_as_income" @top_guidance_partial = "what_counts_as_income"
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = [ @suffix = [

2
app/models/form/lettings/questions/ethnic_white.rb

@ -9,7 +9,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" },
"2" => { "value" => "Irish" }, "2" => { "value" => "Irish" },

4
app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb

@ -15,11 +15,11 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q
end end
def yes_hint def yes_hint
form.start_year_after_2024? ? "This property was previously used for other purposes or is a new-build." : "This is a new let." form.start_year_2024_or_later? ? "This property was previously used for other purposes or is a new-build." : "This is a new let."
end end
def no_hint def no_hint
form.start_year_after_2024? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." form.start_year_2024_or_later? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing."
end end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze

3
app/models/form/lettings/questions/hb.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hb < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "hb" @id = "hb"
@check_answer_label = "Housing-related benefits received"
@header = "Is the household likely to be receiving any of these housing-related benefits?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive." : ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/hbrentshortfall.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "hbrentshortfall" @id = "hbrentshortfall"
@check_answer_label = "Any outstanding amount for basic rent and charges"
@header = "After the household has received any housing-related benefits, will they still need to pay for rent and charges?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Also known as the ‘outstanding amount’."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/household_charge.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::HouseholdCharge < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "household_charge" @id = "household_charge"
@check_answer_label = "Does the household pay rent or charges?"
@header = "Does the household pay rent or other charges for the accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/models/form/lettings/questions/housingneeds_other.rb

@ -9,7 +9,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"0" => { "value" => "No" }, "0" => { "value" => "No" },

4
app/models/form/lettings/questions/incfreq.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "incfreq" @id = "incfreq"
@check_answer_label = "How often does the household receive this amount?" @copy_key = "lettings.income_and_benefits.income_amount.incfreq"
@header = "How often does the household receive this amount?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = true @hidden_in_check_answers = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

6
app/models/form/lettings/questions/is_carehome.rb

@ -2,17 +2,15 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "is_carehome" @id = "is_carehome"
@check_answer_label = "Care home accommodation" @copy_key = "lettings.income_and_benefits.care_home.is_carehome"
@header = "Is this accommodation a care home?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@conditional_for = { "chcharge" => [1] } @conditional_for = { "chcharge" => [1] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"0" => { "value" => "No" }, "0" => { "value" => "No" },

2
app/models/form/lettings/questions/layear.rb

@ -8,7 +8,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "value" => "Just moved to local authority area with this new let" }, "1" => { "value" => "Just moved to local authority area with this new let" },
"2" => { "value" => "Less than 1 year" }, "2" => { "value" => "Less than 1 year" },

2
app/models/form/lettings/questions/letting_allocation.rb

@ -8,7 +8,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." }, "cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." },
"cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." }, "cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." },

3
app/models/form/lettings/questions/major_repairs_date_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::MajorRepairsDateValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "major_repairs_date_value_check" @id = "major_repairs_date_value_check"
@check_answer_label = "Major repairs date confirmation" @copy_key = "lettings.soft_validations.major_repairs_date_value_check"
@header = "Are you sure the property has been vacant for this long?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

3
app/models/form/lettings/questions/multiple_partners_value_check.rb

@ -2,7 +2,7 @@ class Form::Lettings::Questions::MultiplePartnersValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "multiple_partners_value_check" @id = "multiple_partners_value_check"
@check_answer_label = "Multiple partners confirmation" @copy_key = "lettings.soft_validations.multiple_partners_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Lettings::Questions::MultiplePartnersValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

3
app/models/form/lettings/questions/net_income_known.rb

@ -2,12 +2,9 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "net_income_known" @id = "net_income_known"
@check_answer_label = "Do you know the household’s combined total income after tax?"
@header = "Do you know the household’s combined income after tax?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@top_guidance_partial = "what_counts_as_income" @top_guidance_partial = "what_counts_as_income"
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/net_income_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::NetIncomeValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "net_income_value_check" @id = "net_income_value_check"
@check_answer_label = "Net income confirmation" @copy_key = "lettings.soft_validations.net_income_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

3
app/models/form/lettings/questions/no_retirement_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::NoRetirementValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "retirement_value_check" @id = "retirement_value_check"
@check_answer_label = "Retirement confirmation" @copy_key = "lettings.soft_validations.no_retirement_value_check"
@header = "Are you sure this person is retired?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

3
app/models/form/lettings/questions/partner_under_16_value_check.rb

@ -2,7 +2,7 @@ class Form::Lettings::Questions::PartnerUnder16ValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "partner_under_16_value_check" @id = "partner_under_16_value_check"
@check_answer_label = "Partner under 16 confirmation" @copy_key = "lettings.soft_validations.partner_under_16_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Lettings::Questions::PartnerUnder16ValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

3
app/models/form/lettings/questions/period.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Period < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "period" @id = "period"
@check_answer_label = "Frequency of household rent and charges"
@header = "How often does the household pay rent and other charges?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select how often the household is charged. This may be different to how often they pay."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/models/form/lettings/questions/person_relationship.rb

@ -10,7 +10,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"P" => { "value" => "Partner" }, "P" => { "value" => "Partner" },
"C" => { "value" => "Child" }, "C" => { "value" => "Child" },

3
app/models/form/lettings/questions/pregnancy_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::PregnancyValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "pregnancy_value_check" @id = "pregnancy_value_check"
@check_answer_label = "Pregnancy confirmation" @copy_key = page.copy_key
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

2
app/models/form/lettings/questions/previous_let_type.rb

@ -4,7 +4,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question
@id = "unitletas" @id = "unitletas"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS @answer_options = form.start_year_2024_or_later? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/pscharge_4_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/pscharge_bi_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/pscharge_monthly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge_value_check" @id = "pscharge_value_check"
@check_answer_label = "Personal service charge confirmation" @copy_key = "lettings.soft_validations.pscharge_value_check"
@header = "Are you sure?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] }
@hint_text = I18n.t("soft_validations.charges.hint_text")
end end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze

4
app/models/form/lettings/questions/pscharge_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

2
app/models/form/lettings/questions/reason.rb

@ -14,7 +14,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"50" => { "value" => "End of social or private sector tenancy - no fault" }, "50" => { "value" => "End of social or private sector tenancy - no fault" },
"51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" },

2
app/models/form/lettings/questions/reason_renewal.rb

@ -14,7 +14,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"50" => { "value" => "End of social or private sector tenancy - no fault" }, "50" => { "value" => "End of social or private sector tenancy - no fault" },
"51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" },

3
app/models/form/lettings/questions/reasonother_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReasonotherValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonother_value_check" @id = "reasonother_value_check"
@check_answer_label = "Reason other confirmation" @copy_key = "lettings.soft_validations.reasonother_value_check"
@header = "Are you sure this doesn’t fit an existing category?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

2
app/models/form/lettings/questions/referral.rb

@ -9,7 +9,7 @@ class Form::Lettings::Questions::Referral < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

2
app/models/form/lettings/questions/referral_prp.rb

@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

2
app/models/form/lettings/questions/referral_supported_housing.rb

@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

2
app/models/form/lettings/questions/referral_supported_housing_prp.rb

@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"1" => { "1" => {
"value" => "Internal transfer", "value" => "Internal transfer",

3
app/models/form/lettings/questions/referral_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReferralValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral_value_check" @id = "referral_value_check"
@check_answer_label = "Referral confirmation" @copy_key = "lettings.soft_validations.referral_value_check"
@header = "Are you sure?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

2
app/models/form/lettings/questions/rent_type.rb

@ -5,7 +5,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
@copy_key = "lettings.setup.rent_type.rent_type" @copy_key = "lettings.setup.rent_type.rent_type"
@type = "radio" @type = "radio"
@top_guidance_partial = "rent_type_definitions" @top_guidance_partial = "rent_type_definitions"
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS @answer_options = form.start_year_2024_or_later? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS
@conditional_for = { "irproduct_other" => [5] } @conditional_for = { "irproduct_other" => [5] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?
end end

4
app/models/form/lettings/questions/rent_value_check.rb

@ -2,10 +2,8 @@ class Form::Lettings::Questions::RentValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:) def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page) super(id, hsh, page)
@id = "rent_value_check" @id = "rent_value_check"
@check_answer_label = "Total rent confirmation" @copy_key = "lettings.soft_validations.rent_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@hint_text = I18n.t("soft_validations.rent.hint_text")
@check_answers_card_number = check_answers_card_number @check_answers_card_number = check_answers_card_number
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }

3
app/models/form/lettings/questions/retirement_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::RetirementValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "retirement_value_check" @id = "retirement_value_check"
@check_answer_label = "Retirement confirmation" @copy_key = "lettings.soft_validations.retirement_value_check"
@header = "Are you sure this person isn’t retired?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

2
app/models/form/lettings/questions/rsnvac.rb

@ -8,7 +8,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question
end end
def answer_options def answer_options
if form.start_year_after_2024? if form.start_year_2024_or_later?
{ {
"14" => { "14" => {
"value" => "Renewal of fixed-term tenancy", "value" => "Renewal of fixed-term tenancy",

4
app/models/form/lettings/questions/scharge_4_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/scharge_bi_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

4
app/models/form/lettings/questions/scharge_monthly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge_value_check" @id = "scharge_value_check"
@check_answer_label = "Service charge confirmation" @copy_key = "lettings.soft_validations.scharge_value_check"
@header = "Are you sure?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] }
@hint_text = I18n.t("soft_validations.charges.hint_text")
end end
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save