Browse Source

Merge branch 'main' into CLDC-3694-extract-lettings-bu-validations

pull/2747/head
Manny Dinssa 8 months ago committed by GitHub
parent
commit
4230f6902a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/helpers/interruption_screen_helper.rb
  2. 2
      app/models/bulk_upload.rb
  3. 1
      app/models/form/lettings/pages/care_home_weekly.rb
  4. 2
      app/models/form/lettings/pages/income_amount.rb
  5. 1
      app/models/form/lettings/pages/income_known.rb
  6. 1
      app/models/form/lettings/pages/previous_housing_situation.rb
  7. 1
      app/models/form/lettings/pages/previous_housing_situation_renewal.rb
  8. 1
      app/models/form/lettings/pages/previous_local_authority.rb
  9. 1
      app/models/form/lettings/pages/previous_postcode.rb
  10. 1
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
  11. 1
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
  12. 1
      app/models/form/lettings/pages/referral.rb
  13. 1
      app/models/form/lettings/pages/referral_prp.rb
  14. 1
      app/models/form/lettings/pages/referral_supported_housing.rb
  15. 1
      app/models/form/lettings/pages/referral_supported_housing_prp.rb
  16. 2
      app/models/form/lettings/pages/rent_4_weekly.rb
  17. 2
      app/models/form/lettings/pages/rent_bi_weekly.rb
  18. 2
      app/models/form/lettings/pages/rent_monthly.rb
  19. 2
      app/models/form/lettings/pages/rent_weekly.rb
  20. 3
      app/models/form/lettings/questions/benefits.rb
  21. 4
      app/models/form/lettings/questions/brent_4_weekly.rb
  22. 4
      app/models/form/lettings/questions/brent_bi_weekly.rb
  23. 4
      app/models/form/lettings/questions/brent_monthly.rb
  24. 4
      app/models/form/lettings/questions/brent_weekly.rb
  25. 4
      app/models/form/lettings/questions/chcharge_4_weekly.rb
  26. 4
      app/models/form/lettings/questions/chcharge_bi_weekly.rb
  27. 4
      app/models/form/lettings/questions/chcharge_monthly.rb
  28. 4
      app/models/form/lettings/questions/chcharge_weekly.rb
  29. 2
      app/models/form/lettings/questions/declaration.rb
  30. 4
      app/models/form/lettings/questions/earnings.rb
  31. 3
      app/models/form/lettings/questions/hb.rb
  32. 3
      app/models/form/lettings/questions/hbrentshortfall.rb
  33. 3
      app/models/form/lettings/questions/homeless.rb
  34. 3
      app/models/form/lettings/questions/household_charge.rb
  35. 4
      app/models/form/lettings/questions/incfreq.rb
  36. 4
      app/models/form/lettings/questions/is_carehome.rb
  37. 3
      app/models/form/lettings/questions/layear.rb
  38. 3
      app/models/form/lettings/questions/letting_allocation.rb
  39. 3
      app/models/form/lettings/questions/net_income_known.rb
  40. 3
      app/models/form/lettings/questions/period.rb
  41. 4
      app/models/form/lettings/questions/ppcodenk.rb
  42. 4
      app/models/form/lettings/questions/ppostcode_full.rb
  43. 4
      app/models/form/lettings/questions/previous_la_known.rb
  44. 4
      app/models/form/lettings/questions/previous_tenure.rb
  45. 5
      app/models/form/lettings/questions/previous_tenure_renewal.rb
  46. 4
      app/models/form/lettings/questions/prevloc.rb
  47. 4
      app/models/form/lettings/questions/pscharge_4_weekly.rb
  48. 4
      app/models/form/lettings/questions/pscharge_bi_weekly.rb
  49. 4
      app/models/form/lettings/questions/pscharge_monthly.rb
  50. 4
      app/models/form/lettings/questions/pscharge_weekly.rb
  51. 4
      app/models/form/lettings/questions/reason.rb
  52. 4
      app/models/form/lettings/questions/reason_renewal.rb
  53. 3
      app/models/form/lettings/questions/reasonable_preference_reason.rb
  54. 4
      app/models/form/lettings/questions/reasonother.rb
  55. 3
      app/models/form/lettings/questions/reasonpref.rb
  56. 4
      app/models/form/lettings/questions/referral.rb
  57. 4
      app/models/form/lettings/questions/referral_prp.rb
  58. 4
      app/models/form/lettings/questions/referral_supported_housing.rb
  59. 4
      app/models/form/lettings/questions/referral_supported_housing_prp.rb
  60. 2
      app/models/form/lettings/questions/rent_type.rb
  61. 4
      app/models/form/lettings/questions/scharge_4_weekly.rb
  62. 4
      app/models/form/lettings/questions/scharge_bi_weekly.rb
  63. 4
      app/models/form/lettings/questions/scharge_monthly.rb
  64. 4
      app/models/form/lettings/questions/scharge_weekly.rb
  65. 4
      app/models/form/lettings/questions/supcharg_4_weekly.rb
  66. 4
      app/models/form/lettings/questions/supcharg_bi_weekly.rb
  67. 4
      app/models/form/lettings/questions/supcharg_monthly.rb
  68. 4
      app/models/form/lettings/questions/supcharg_weekly.rb
  69. 4
      app/models/form/lettings/questions/tcharge_4_weekly.rb
  70. 4
      app/models/form/lettings/questions/tcharge_bi_weekly.rb
  71. 4
      app/models/form/lettings/questions/tcharge_monthly.rb
  72. 4
      app/models/form/lettings/questions/tcharge_weekly.rb
  73. 3
      app/models/form/lettings/questions/tshortfall.rb
  74. 4
      app/models/form/lettings/questions/tshortfall_known.rb
  75. 3
      app/models/form/lettings/questions/waityear.rb
  76. 2
      app/models/form/sales/pages/about_staircase.rb
  77. 1
      app/models/form/sales/pages/buyer_previous.rb
  78. 2
      app/models/form/sales/pages/deposit.rb
  79. 5
      app/models/form/sales/pages/deposit_and_mortgage_value_check.rb
  80. 2
      app/models/form/sales/pages/deposit_discount.rb
  81. 2
      app/models/form/sales/pages/deposit_value_check.rb
  82. 2
      app/models/form/sales/pages/discount.rb
  83. 5
      app/models/form/sales/pages/discounted_sale_value_check.rb
  84. 2
      app/models/form/sales/pages/equity.rb
  85. 1
      app/models/form/sales/pages/exchange_date.rb
  86. 2
      app/models/form/sales/pages/extra_borrowing.rb
  87. 5
      app/models/form/sales/pages/extra_borrowing_value_check.rb
  88. 2
      app/models/form/sales/pages/grant.rb
  89. 5
      app/models/form/sales/pages/grant_value_check.rb
  90. 1
      app/models/form/sales/pages/handover_date.rb
  91. 3
      app/models/form/sales/pages/handover_date_check.rb
  92. 1
      app/models/form/sales/pages/la_nominations.rb
  93. 1
      app/models/form/sales/pages/leasehold_charges.rb
  94. 3
      app/models/form/sales/pages/living_before_purchase.rb
  95. 1
      app/models/form/sales/pages/monthly_rent.rb
  96. 2
      app/models/form/sales/pages/mortgage_amount.rb
  97. 2
      app/models/form/sales/pages/mortgage_lender.rb
  98. 2
      app/models/form/sales/pages/mortgage_lender_other.rb
  99. 1
      app/models/form/sales/pages/mortgage_length.rb
  100. 2
      app/models/form/sales/pages/mortgageused.rb
  101. Some files were not shown because too many files have changed in this diff Show More

1
app/helpers/interruption_screen_helper.rb

@ -1,6 +1,7 @@
module InterruptionScreenHelper
def display_informative_text(informative_text, log)
return informative_text if informative_text.is_a? String
return "" if informative_text.nil?
return "" unless informative_text["arguments"]
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_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) }
has_paper_trail
def completed?
incomplete_logs = logs.where.not(status: "completed")
!incomplete_logs.exists?

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)
super
@id = "care_home_weekly"
@copy_key = "lettings.income_and_benefits.care_home"
@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" => nil },

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)
super
@id = "income_amount"
@header = "Total household income"
@copy_key = "lettings.income_and_benefits.income_amount"
@depends_on = [{ "net_income_known" => 0 }]
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)
super
@id = "income_known"
@header = "Household’s combined income after tax"
end
def questions

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituation < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_housing_situation"
@copy_key = "lettings.household_situation.prevten.not_renewal"
@depends_on = [{ "is_renewal?" => false }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituationRenewal < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_housing_situation_renewal"
@copy_key = "lettings.household_situation.prevten.renewal"
@depends_on = [{ "is_renewal?" => true, "is_supported_housing?" => true }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousLocalAuthority < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_local_authority"
@copy_key = "lettings.household_situation.previous_local_authority"
@depends_on = [{ "is_previous_la_inferred" => false, "renewal" => 0 }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousPostcode < ::Form::Page
def initialize(id, hsh, page)
super
@depends_on = [{ "renewal" => 0 }]
@copy_key = "lettings.household_situation.previous_postcode"
end
def questions

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHome < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "reason_for_leaving_last_settled_home"
@copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home"
@depends_on = [{ "renewal" => 0 }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Pa
def initialize(id, hsh, subsection)
super
@id = "reason_for_leaving_last_settled_home_renewal"
@copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home_renewal"
@depends_on = [{ "renewal" => 1 }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::Referral < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral"
@copy_key = "lettings.household_situation.referral.general_needs.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_prp"
@copy_key = "lettings.household_situation.referral.general_needs.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_supported_housing"
@copy_key = "lettings.household_situation.referral.supported_housing.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }]
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_supported_housing_prp"
@copy_key = "lettings.household_situation.referral.supported_housing.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }]
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)
super
@id = "rent_4_weekly"
@header = "Household rent and charges"
@copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "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 },

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)
super
@id = "rent_bi_weekly"
@header = "Household rent and charges"
@copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "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 },

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)
super
@id = "rent_monthly"
@header = "Household rent and charges"
@copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },

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)
super
@id = "rent_weekly"
@header = "Household rent and charges"
@copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => 0, "is_carehome?" => false },
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => nil, "is_carehome?" => false },

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Benefits < ::Form::Question
def initialize(id, hsh, page)
super
@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"
@check_answers_card_number = 0
@hint_text = "This excludes child and housing benefit, council tax support and tax credits."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
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)
super
@id = "brent"
@check_answer_label = "Basic rent"
@header = "What is the basic rent?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 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
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "brent"
@check_answer_label = "Basic rent"
@header = "What is the basic rent?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 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
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "brent"
@check_answer_label = "Basic rent"
@header = "What is the basic rent?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 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
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "brent"
@check_answer_label = "Basic rent"
@header = "What is the basic rent?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 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
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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)
super
@id = "chcharge"
@check_answer_label = "Care home charges"
@header = "How much does the household pay every 4 weeks?"
@copy_key = "lettings.income_and_benefits.care_home.chcharge_4_weekly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@hint_text = ""
@step = 0.01
@prefix = "£"
@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)
super
@id = "chcharge"
@check_answer_label = "Care home charges"
@header = "How much does the household pay every 2 weeks?"
@copy_key = "lettings.income_and_benefits.care_home.chcharge_bi_weekly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@hint_text = ""
@step = 0.01
@prefix = "£"
@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)
super
@id = "chcharge"
@check_answer_label = "Care home charges"
@header = "How much does the household pay every month?"
@copy_key = "lettings.income_and_benefits.care_home.chcharge_monthly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@hint_text = ""
@step = 0.01
@prefix = "£"
@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)
super
@id = "chcharge"
@check_answer_label = "Care home charges"
@header = "How much does the household pay every week?"
@copy_key = "lettings.income_and_benefits.care_home.chcharge_weekly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@hint_text = ""
@step = 0.01
@prefix = "£"
@suffix = " every week"

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

@ -4,7 +4,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
@id = "declaration"
@type = "checkbox"
@check_answers_card_number = 0 unless form.start_year_after_2024?
@top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "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]
end

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

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

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hb < ::Form::Question
def initialize(id, hsh, page)
super
@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"
@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
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
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)
super
@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"
@check_answers_card_number = 0
@hint_text = "Also known as the ‘outstanding amount’."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Homeless < ::Form::Question
def initialize(id, hsh, page)
super
@id = "homeless"
@check_answer_label = "Household homeless immediately before letting"
@header = "Did the household experience homelessness immediately before this letting?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
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)
super
@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"
@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
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question
def initialize(id, hsh, page)
super
@id = "incfreq"
@check_answer_label = "How often does the household receive this amount?"
@header = "How often does the household receive this amount?"
@copy_key = "lettings.income_and_benefits.income_amount.incfreq"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@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]

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

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

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Layear < ::Form::Question
def initialize(id, hsh, page)
super
@id = "layear"
@check_answer_label = "Length of time in local authority area"
@header = "How long has the household continuously lived in the local authority area of the new letting?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
def initialize(id, hsh, page)
super
@id = "letting_allocation"
@check_answer_label = "Allocation system"
@header = "How was this letting allocated?"
@type = "checkbox"
@check_answers_card_number = 0
@hint_text = "Select all that apply."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
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)
super
@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"
@check_answers_card_number = 0
@top_guidance_partial = "what_counts_as_income"
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
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)
super
@id = "period"
@check_answer_label = "Frequency of household rent and charges"
@header = "How often does the household pay rent and other charges?"
@type = "radio"
@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
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ppcodenk"
@check_answer_label = ""
@header = "Do you know the postcode of the household’s last settled accommodation?"
@copy_key = "lettings.household_situation.previous_postcode.ppcodenk"
@type = "radio"
@check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "ppostcode_full" => [0] }
@hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] }

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ppostcode_full"
@check_answer_label = "Postcode of household’s last settled accommodation"
@header = "Postcode for the previous accommodation"
@copy_key = "lettings.household_situation.previous_postcode.ppostcode_full"
@type = "text"
@width = 5
@inferred_check_answers_value = [{
@ -13,7 +12,6 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
"value" => "Not known",
}]
@check_answers_card_number = 0
@hint_text = ""
@inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "previous_la_known"
@check_answer_label = "Do you know the local authority of the household’s last settled accommodation?"
@header = "Do you know the local authority of the household’s last settled accommodation?"
@copy_key = "lettings.household_situation.previous_local_authority.previous_la_known"
@type = "radio"
@check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "prevloc" => [1] }
@hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] }

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question
def initialize(id, hsh, page)
super
@id = "prevten"
@check_answer_label = "Where was the household immediately before this letting?"
@header = "Where was the household immediately before this letting?"
@copy_key = "lettings.household_situation.prevten.not_renewal"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "This is where the household was the night before they moved into this new let."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

5
app/models/form/lettings/questions/previous_tenure_renewal.rb

@ -2,12 +2,9 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question
def initialize(id, hsh, page)
super
@id = "prevten"
@check_answer_label = "Where was the household immediately before this letting?"
@header = "Where was the household immediately before this letting?"
@copy_key = "lettings.household_situation.prevten.renewal"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "You told us this letting is a renewal. We have removed some options because of this.<br><br>
This is where the household was the night before they moved into this new let."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,12 +2,10 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page)
super
@id = "prevloc"
@check_answer_label = "Location of household’s last settled accommodation"
@header = "Select a local authority"
@copy_key = "lettings.household_situation.previous_local_authority.prevloc"
@type = "select"
@inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }]
@check_answers_card_number = 0
@hint_text = "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
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)
super
@id = "pscharge"
@check_answer_label = "Personal service charge"
@header = "What is the personal service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "pscharge"
@check_answer_label = "Personal service charge"
@header = "What is the personal service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "pscharge"
@check_answer_label = "Personal service charge"
@header = "What is the personal service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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)
super
@id = "pscharge"
@check_answer_label = "Personal service charge"
@header = "What is the personal service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reason < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reason"
@check_answer_label = "Reason for leaving last settled home"
@header = "What is the tenant’s main reason for the household leaving their last settled home?"
@copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@type = "radio"
@check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." : "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously."
@conditional_for = {
"reasonother" => [
20,

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reason"
@check_answer_label = "Reason for leaving last settled home"
@header = "What is the tenant’s main reason for the household leaving their last settled home?"
@type = "radio"
@copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@check_answers_card_number = 0
@hint_text = "You told us this letting is a renewal. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@conditional_for = {
"reasonother" => [

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reasonable_preference_reason"
@check_answer_label = "Reason for reasonable preference"
@header = "Why was the household given ‘reasonable preference’?"
@type = "checkbox"
@check_answers_card_number = 0
@hint_text = "Select all that apply."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reasonother"
@check_answer_label = ""
@header = "What is the reason?"
@copy_key = "lettings.household_situation.reason.#{@page.id}.reasonother"
@type = "text"
@check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reasonpref"
@check_answer_label = "Household given reasonable preference"
@header = "Was the household given ‘reasonable preference’ by the local authority?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’." : "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Referral < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
@check_answer_label = "Source of referral for letting"
@header = "What was the source of referral for this letting?"
@copy_key = "lettings.household_situation.referral.general_needs.la"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
@check_answer_label = "Source of referral for letting"
@header = "What was the source of referral for this letting?"
@copy_key = "lettings.household_situation.referral.general_needs.prp"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "You told us that the needs type is general needs. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
@check_answer_label = "Source of referral for letting"
@header = "What was the source of referral for this letting?"
@copy_key = "lettings.household_situation.referral.supported_housing.la"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "You told us that you are a local authority. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
@check_answer_label = "Source of referral for letting"
@header = "What was the source of referral for this letting?"
@copy_key = "lettings.household_situation.referral.supported_housing.prp"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -4,7 +4,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
@id = "rent_type"
@copy_key = "lettings.setup.rent_type.rent_type"
@type = "radio"
@top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions"
@top_guidance_partial = "rent_type_definitions"
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS
@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?

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)
super
@id = "scharge"
@check_answer_label = "Service charge"
@header = "What is the service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "scharge"
@check_answer_label = "Service charge"
@header = "What is the service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@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)
super
@id = "scharge"
@check_answer_label = "Service charge"
@header = "What is the service charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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

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

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
@check_answer_label = "Support charge"
@header = "What is the support charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
@check_answer_label = "Support charge"
@header = "What is the support charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
@check_answer_label = "Support charge"
@header = "What is the support charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
@check_answer_label = "Support charge"
@header = "What is the support charge?"
@copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Tcharge4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
@check_answer_label = "Household rent and charges"
@header = "Total charge"
@copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
@check_answer_label = "Household rent and charges"
@header = "Total charge"
@copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
@check_answer_label = "Household rent and charges"
@header = "Total charge"
@copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
@check_answer_label = "Household rent and charges"
@header = "Total charge"
@copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tshortfall"
@check_answer_label = "Estimated outstanding amount"
@header = "Estimated outstanding amount"
@copy_key = "lettings.income_and_benefits.outstanding_amount.tshortfall"
@type = "numeric"
@width = 5
@check_answers_card_number = 0

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tshortfall_known"
@check_answer_label = "Do you know the outstanding amount?"
@header = "Can you estimate the outstanding amount?"
@copy_key = "lettings.income_and_benefits.outstanding_amount.tshortfall_known"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "You only need to give an approximate figure."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "tshortfall" => [0] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
def initialize(id, hsh, page)
super
@id = "waityear"
@check_answer_label = "Length of time on local authority waiting list"
@header = form.start_year_after_2024? ? "How long has the household been on the local authority waiting list for the area of the new letting?" : "How long has the household been on the local authority waiting list for the new letting?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

2
app/models/form/sales/pages/about_staircase.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::AboutStaircase < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
@header = "About the staircasing transaction"
@copy_key = "sales.sale_information.about_staircasing"
@depends_on = [{
"staircase" => 1,
"joint_purchase?" => joint_purchase,

1
app/models/form/sales/pages/buyer_previous.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
@copy_key = "sales.sale_information.soctenant.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@depends_on = [{ "joint_purchase?" => joint_purchase, "soctenant_is_inferred?" => false }]
end

2
app/models/form/sales/pages/deposit.rb

@ -3,7 +3,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@optional = optional
@header = "About the deposit"
@copy_key = "sales.sale_information.deposit"
end
def questions

5
app/models/form/sales/pages/deposit_and_mortgage_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::DepositAndMortgageValueCheck < ::Form::Page
"mortgage_plus_deposit_less_than_discounted_value?" => true,
},
]
@copy_key = "sales.soft_validations.deposit_and_mortgage_value_check"
@title_text = {
"translation" => "soft_validations.deposit_and_mortgage.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "mortgage",
@ -27,7 +28,7 @@ class Form::Sales::Pages::DepositAndMortgageValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.deposit_and_mortgage.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

2
app/models/form/sales/pages/deposit_discount.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page
def initialize(id, hsh, subsection, optional:)
super(id, hsh, subsection)
@optional = optional
@header = "About the deposit"
@copy_key = "sales.sale_information.cashdis"
end
def questions

2
app/models/form/sales/pages/deposit_value_check.rb

@ -26,7 +26,7 @@ class Form::Sales::Pages::DepositValueCheck < ::Form::Page
def questions
@questions ||= [
Form::Sales::Questions::DepositValueCheck.new(nil, nil, self),
Form::Sales::Questions::DepositValueCheck.new(nil, nil, self, joint_purchase: @joint_purchase),
]
end

2
app/models/form/sales/pages/discount.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Discount < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "discount"
@header = "About the price of the property"
@copy_key = "sales.sale_information.discount"
@depends_on = [{
"right_to_buy?" => true,
}]

5
app/models/form/sales/pages/discounted_sale_value_check.rb

@ -2,8 +2,9 @@ class Form::Sales::Pages::DiscountedSaleValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index = nil)
super(id, hsh, subsection)
@depends_on = depends_on
@copy_key = "sales.soft_validations.discounted_sale_value_check"
@title_text = {
"translation" => "soft_validations.discounted_sale_value.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@ -13,7 +14,7 @@ class Form::Sales::Pages::DiscountedSaleValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.discounted_sale_value.informative_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",

2
app/models/form/sales/pages/equity.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Equity < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "equity"
@header = "About the price of the property"
@copy_key = "sales.sale_information.equity"
end
def questions

1
app/models/form/sales/pages/exchange_date.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::ExchangeDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "exchange_contracts"
@copy_key = "sales.sale_information.exchange_date"
@depends_on = [{
"resale" => 2,
}]

2
app/models/form/sales/pages/extra_borrowing.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::ExtraBorrowing < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = ""
@copy_key = "sales.sale_information.extrabor"
@description = ""
@subsection = subsection
@depends_on = [{

5
app/models/form/sales/pages/extra_borrowing_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::ExtraBorrowingValueCheck < Form::Page
"extra_borrowing_expected_but_not_reported?" => true,
},
]
@copy_key = "sales.soft_validations.extra_borrowing_value_check"
@title_text = {
"translation" => "soft_validations.extra_borrowing.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@ -17,7 +18,7 @@ class Form::Sales::Pages::ExtraBorrowingValueCheck < Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.extra_borrowing.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

2
app/models/form/sales/pages/grant.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Grant < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "grant"
@header = "About the price of the property"
@copy_key = "sales.sale_information.grant"
@depends_on = [{
"right_to_buy?" => false,
"rent_to_buy_full_ownership?" => false,

5
app/models/form/sales/pages/grant_value_check.rb

@ -2,13 +2,14 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "grant_value_check"
@copy_key = "sales.soft_validations.grant_value_check"
@depends_on = [
{
"grant_outside_common_range?" => true,
},
]
@title_text = {
"translation" => "soft_validations.grant.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@ -18,7 +19,7 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.grant.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

1
app/models/form/sales/pages/handover_date.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::HandoverDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "handover_date"
@copy_key = "sales.sale_information.handover_date"
@depends_on = [
{ "ownershipsch" => 1, "resale" => 2 },
]

3
app/models/form/sales/pages/handover_date_check.rb

@ -2,11 +2,12 @@ class Form::Sales::Pages::HandoverDateCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "handover_date_check"
@copy_key = "sales.soft_validations.hodate_check"
@depends_on = [{ "saledate_check" => nil, "hodate_3_years_or_more_saledate?" => true },
{ "saledate_check" => 1, "hodate_3_years_or_more_saledate?" => true }]
@informative_text = {}
@title_text = {
"translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
end

1
app/models/form/sales/pages/la_nominations.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "la_nominations"
@copy_key = "sales.sale_information.la_nominations"
end
def questions

1
app/models/form/sales/pages/leasehold_charges.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LeaseholdCharges < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@copy_key = "sales.sale_information.leaseholdcharges"
end
def questions

3
app/models/form/sales/pages/living_before_purchase.rb

@ -3,12 +3,13 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@joint_purchase = joint_purchase
@copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
def questions
@questions ||= [
living_before_purchase,
Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch),
Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch, joint_purchase: @joint_purchase),
].compact
end

1
app/models/form/sales/pages/monthly_rent.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::MonthlyRent < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "monthly_rent"
@copy_key = "sales.sale_information.mrent"
end
def questions

2
app/models/form/sales/pages/mortgage_amount.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = "Mortgage Amount"
@copy_key = "sales.sale_information.mortgage"
@depends_on = [{ "mortgage_used?" => true }]
end

2
app/models/form/sales/pages/mortgage_lender.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageLender < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = ""
@copy_key = "sales.sale_information.mortgagelender"
@description = ""
@subsection = subsection
@depends_on = [{

2
app/models/form/sales/pages/mortgage_lender_other.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageLenderOther < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = ""
@copy_key = "sales.sale_information.mortgagelenderother"
@description = ""
@subsection = subsection
@depends_on = [{

1
app/models/form/sales/pages/mortgage_length.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@copy_key = "sales.sale_information.mortlen"
@depends_on = [{
"mortgageused" => 1,
}]

2
app/models/form/sales/pages/mortgageused.rb

@ -1,7 +1,7 @@
class Form::Sales::Pages::Mortgageused < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@header = "Mortgage Amount"
@copy_key = "sales.sale_information.mortgageused"
@ownershipsch = ownershipsch
end

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

Loading…
Cancel
Save