Browse Source

CLDC-1911 Add form definition for 23/24 lettings (#1254)

* Spike for generating form

* Add remaining field mappings

* Add question attributes conditionally

* Display page attributes conditionally

* update subsection formatting

* Update section formatting

* fix generator

* Fix generator

* Update the form handler and form to create post 2021 forms programatically

* Initially generated and linted form

* Cover lettings sections and subsections wiht tests

* Cover age pages and questions with tests

* Add reusable age questions and adjust the tests

* Add a generic person age page using generic questions and adjust specs

* Multiline arrays in subsections

* Use generic person age page in household characteristics and remove unused pages/questions

* Combine and reduce tests

* Backfill duplicate rsnvac question

* Backfill repeating question

* Backfill repeating voiddate

* Backfill repeating tenancy question

* Backfill ethnic questions

* Backfill reason question

* Backfill prevten question

* Backfill referral questions

* Backfill chcharges questions

* Backfill brent questions

* Backfill scharge

* Backfill pscharge

* Backfill supcharg

* Backfill tcharge

* Backfill retirement value check question

* Make person known questions generic

* Make person gender identity questions generic

* Make relationship questions generic

* Make working situation questions generic

* make retirement check generic

* make pregnant household check generic

* Make pregnancy value checks generic, again

* Undo for and form handler changes

* Remove generate form task and service

* Remove empty headers, descriptions and initializers from pages

* Fix tests

* lint
pull/1264/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
7f76fffcce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/models/form/lettings/pages/access_needs_exist.rb
  2. 5
      app/models/form/lettings/pages/allocation_system.rb
  3. 5
      app/models/form/lettings/pages/armed_forces.rb
  4. 11
      app/models/form/lettings/pages/armed_forces_injured.rb
  5. 11
      app/models/form/lettings/pages/armed_forces_serving.rb
  6. 5
      app/models/form/lettings/pages/benefits_proportion.rb
  7. 17
      app/models/form/lettings/pages/care_home_4_weekly.rb
  8. 17
      app/models/form/lettings/pages/care_home_bi_weekly.rb
  9. 17
      app/models/form/lettings/pages/care_home_monthly.rb
  10. 27
      app/models/form/lettings/pages/care_home_weekly.rb
  11. 11
      app/models/form/lettings/pages/declaration.rb
  12. 19
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb
  13. 19
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb
  14. 19
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb
  15. 36
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb
  16. 36
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb
  17. 19
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb
  18. 11
      app/models/form/lettings/pages/first_time_property_let_as_social_housing.rb
  19. 11
      app/models/form/lettings/pages/health_condition_effects.rb
  20. 5
      app/models/form/lettings/pages/health_conditions.rb
  21. 5
      app/models/form/lettings/pages/homelessness.rb
  22. 11
      app/models/form/lettings/pages/household_members.rb
  23. 5
      app/models/form/lettings/pages/housing_benefit.rb
  24. 15
      app/models/form/lettings/pages/income_amount.rb
  25. 11
      app/models/form/lettings/pages/income_known.rb
  26. 5
      app/models/form/lettings/pages/joint.rb
  27. 14
      app/models/form/lettings/pages/lead_tenant_age.rb
  28. 11
      app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb
  29. 11
      app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb
  30. 11
      app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb
  31. 11
      app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb
  32. 11
      app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb
  33. 11
      app/models/form/lettings/pages/lead_tenant_ethnic_group.rb
  34. 11
      app/models/form/lettings/pages/lead_tenant_gender_identity.rb
  35. 11
      app/models/form/lettings/pages/lead_tenant_nationality.rb
  36. 32
      app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb
  37. 32
      app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb
  38. 11
      app/models/form/lettings/pages/lead_tenant_working_situation.rb
  39. 10
      app/models/form/lettings/pages/location.rb
  40. 25
      app/models/form/lettings/pages/max_rent_value_check.rb
  41. 25
      app/models/form/lettings/pages/min_rent_value_check.rb
  42. 19
      app/models/form/lettings/pages/net_income_value_check.rb
  43. 15
      app/models/form/lettings/pages/new_build_handover_date.rb
  44. 19
      app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb
  45. 19
      app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb
  46. 19
      app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb
  47. 19
      app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb
  48. 19
      app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb
  49. 19
      app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb
  50. 16
      app/models/form/lettings/pages/outstanding.rb
  51. 14
      app/models/form/lettings/pages/outstanding_amount.rb
  52. 15
      app/models/form/lettings/pages/person_age.rb
  53. 12
      app/models/form/lettings/pages/person_gender_identity.rb
  54. 13
      app/models/form/lettings/pages/person_known.rb
  55. 36
      app/models/form/lettings/pages/person_over_retirement_value_check.rb
  56. 12
      app/models/form/lettings/pages/person_relationship_to_lead.rb
  57. 36
      app/models/form/lettings/pages/person_under_retirement_value_check.rb
  58. 21
      app/models/form/lettings/pages/person_working_situation.rb
  59. 5
      app/models/form/lettings/pages/pregnant.rb
  60. 11
      app/models/form/lettings/pages/previous_housing_situation.rb
  61. 11
      app/models/form/lettings/pages/previous_housing_situation_renewal.rb
  62. 14
      app/models/form/lettings/pages/previous_local_authority.rb
  63. 8
      app/models/form/lettings/pages/previous_postcode.rb
  64. 11
      app/models/form/lettings/pages/property_building_type.rb
  65. 11
      app/models/form/lettings/pages/property_let_type.rb
  66. 11
      app/models/form/lettings/pages/property_local_authority.rb
  67. 25
      app/models/form/lettings/pages/property_major_repairs.rb
  68. 13
      app/models/form/lettings/pages/property_major_repairs_value_check.rb
  69. 11
      app/models/form/lettings/pages/property_number_of_bedrooms.rb
  70. 11
      app/models/form/lettings/pages/property_number_of_times_relet_not_social_let.rb
  71. 11
      app/models/form/lettings/pages/property_number_of_times_relet_social_let.rb
  72. 14
      app/models/form/lettings/pages/property_postcode.rb
  73. 11
      app/models/form/lettings/pages/property_unit_type.rb
  74. 11
      app/models/form/lettings/pages/property_vacancy_reason_first_let.rb
  75. 11
      app/models/form/lettings/pages/property_vacancy_reason_not_first_let.rb
  76. 11
      app/models/form/lettings/pages/property_wheelchair_accessible.rb
  77. 14
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
  78. 11
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
  79. 5
      app/models/form/lettings/pages/reasonable_preference.rb
  80. 11
      app/models/form/lettings/pages/reasonable_preference_reason.rb
  81. 11
      app/models/form/lettings/pages/referral.rb
  82. 11
      app/models/form/lettings/pages/referral_prp.rb
  83. 11
      app/models/form/lettings/pages/referral_supported_housing.rb
  84. 11
      app/models/form/lettings/pages/referral_supported_housing_prp.rb
  85. 23
      app/models/form/lettings/pages/rent_4_weekly.rb
  86. 23
      app/models/form/lettings/pages/rent_bi_weekly.rb
  87. 23
      app/models/form/lettings/pages/rent_monthly.rb
  88. 11
      app/models/form/lettings/pages/rent_or_other_charges.rb
  89. 11
      app/models/form/lettings/pages/rent_period.rb
  90. 43
      app/models/form/lettings/pages/rent_weekly.rb
  91. 8
      app/models/form/lettings/pages/scheme.rb
  92. 11
      app/models/form/lettings/pages/shelteredaccom.rb
  93. 5
      app/models/form/lettings/pages/starter_tenancy.rb
  94. 14
      app/models/form/lettings/pages/starter_tenancy_type.rb
  95. 11
      app/models/form/lettings/pages/tenancy_length.rb
  96. 14
      app/models/form/lettings/pages/tenancy_type.rb
  97. 5
      app/models/form/lettings/pages/time_lived_in_local_authority.rb
  98. 11
      app/models/form/lettings/pages/time_on_waiting_list.rb
  99. 15
      app/models/form/lettings/pages/type_of_access_needs.rb
  100. 13
      app/models/form/lettings/pages/void_date_value_check.rb
  101. Some files were not shown because too many files have changed in this diff Show More

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::AccessNeedsExist < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Housingneeds.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::AllocationSystem < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::LettingAllocation.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::ArmedForces < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Armedforces.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/armed_forces_injured.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ArmedForcesInjured < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "armed_forces_injured"
@depends_on = [{ "armedforces" => 1 }, { "armedforces" => 4 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Reservist.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/armed_forces_serving.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ArmedForcesServing < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "armed_forces_serving"
@depends_on = [{ "armedforces" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Leftreg.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::BenefitsProportion < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Benefits.new(nil, nil, self)]
end
end

17
app/models/form/lettings/pages/care_home_4_weekly.rb

@ -0,0 +1,17 @@
class Form::Lettings::Pages::CareHome4Weekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "care_home_4_weekly"
@depends_on = [
{ "period" => 3, "needstype" => 2, "household_charge" => 0 },
{ "period" => 3, "needstype" => 2, "household_charge" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::IsCarehome.new(nil, nil, self),
Form::Lettings::Questions::Chcharge4Weekly.new(nil, nil, self),
]
end
end

17
app/models/form/lettings/pages/care_home_bi_weekly.rb

@ -0,0 +1,17 @@
class Form::Lettings::Pages::CareHomeBiWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "care_home_bi_weekly"
@depends_on = [
{ "period" => 2, "needstype" => 2, "household_charge" => 0 },
{ "period" => 2, "needstype" => 2, "household_charge" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::IsCarehome.new(nil, nil, self),
Form::Lettings::Questions::ChchargeBiWeekly.new(nil, nil, self),
]
end
end

17
app/models/form/lettings/pages/care_home_monthly.rb

@ -0,0 +1,17 @@
class Form::Lettings::Pages::CareHomeMonthly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "care_home_monthly"
@depends_on = [
{ "period" => 4, "needstype" => 2, "household_charge" => 0 },
{ "period" => 4, "needstype" => 2, "household_charge" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::IsCarehome.new(nil, nil, self),
Form::Lettings::Questions::ChchargeMonthly.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,27 @@
class Form::Lettings::Pages::CareHomeWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "care_home_weekly"
@depends_on = [
{ "period" => 1, "needstype" => 2, "household_charge" => 0 },
{ "period" => 1, "needstype" => 2, "household_charge" => nil },
{ "period" => 5, "needstype" => 2, "household_charge" => 0 },
{ "period" => 5, "needstype" => 2, "household_charge" => nil },
{ "period" => 6, "needstype" => 2, "household_charge" => 0 },
{ "period" => 6, "needstype" => 2, "household_charge" => nil },
{ "period" => 7, "needstype" => 2, "household_charge" => 0 },
{ "period" => 7, "needstype" => 2, "household_charge" => nil },
{ "period" => 8, "needstype" => 2, "household_charge" => 0 },
{ "period" => 8, "needstype" => 2, "household_charge" => nil },
{ "period" => 9, "needstype" => 2, "household_charge" => 0 },
{ "period" => 9, "needstype" => 2, "household_charge" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::IsCarehome.new(nil, nil, self),
Form::Lettings::Questions::ChchargeWeekly.new(nil, nil, self),
]
end
end

11
app/models/form/lettings/pages/declaration.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::Declaration < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "declaration"
@header = "Department for Levelling Up, Housing & Communities privacy notice"
end
def questions
@questions ||= [Form::Lettings::Questions::Declaration.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "females_in_soft_age_range_in_pregnant_household_lead_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,36 @@
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check"
@depends_on = [
{
"female_in_pregnant_household_in_soft_validation_range?" => true,
"age#{person_index}_known" => 0,
},
]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range",
"arguments" => [
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,36 @@
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check"
@depends_on = [
{
"female_in_pregnant_household_in_soft_validation_range?" => true,
"details_known_#{person_index}" => 0,
},
]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range",
"arguments" => [
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "females_in_soft_age_range_in_pregnant_household_value_check"
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/first_time_property_let_as_social_housing.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "first_time_property_let_as_social_housing"
@depends_on = [{ "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/health_condition_effects.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::HealthConditionEffects < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "health_condition_effects"
@depends_on = [{ "illness" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::ConditionEffects.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::HealthConditions < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Illness.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::Homelessness < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Homeless.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/household_members.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::HouseholdMembers < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "household_members"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Hhmemb.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::HousingBenefit < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Hb.new(nil, nil, self)]
end
end

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

@ -0,0 +1,15 @@
class Form::Lettings::Pages::IncomeAmount < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "income_amount"
@header = "Total household income"
@depends_on = [{ "net_income_known" => 0 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::Earnings.new(nil, nil, self),
Form::Lettings::Questions::Incfreq.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,11 @@
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
@questions ||= [Form::Lettings::Questions::NetIncomeKnown.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::Joint < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Joint.new(nil, nil, self)]
end
end

14
app/models/form/lettings/pages/lead_tenant_age.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::LeadTenantAge < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_age"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::Age1Known.new(nil, nil, self),
Form::Lettings::Questions::Age1.new(nil, nil, self),
]
end
end

11
app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantEthnicBackgroundArab < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_ethnic_background_arab"
@depends_on = [{ "ethnic_group" => 4 }]
end
def questions
@questions ||= [Form::Lettings::Questions::EthnicArab.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantEthnicBackgroundAsian < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_ethnic_background_asian"
@depends_on = [{ "ethnic_group" => 2 }]
end
def questions
@questions ||= [Form::Lettings::Questions::EthnicAsian.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantEthnicBackgroundBlack < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_ethnic_background_black"
@depends_on = [{ "ethnic_group" => 3 }]
end
def questions
@questions ||= [Form::Lettings::Questions::EthnicBlack.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantEthnicBackgroundMixed < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_ethnic_background_mixed"
@depends_on = [{ "ethnic_group" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::EthnicMixed.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_ethnic_background_white"
@depends_on = [{ "ethnic_group" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::EthnicWhite.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_ethnic_group.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantEthnicGroup < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_ethnic_group"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::EthnicGroup.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_gender_identity.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantGenderIdentity < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_gender_identity"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::GenderIdentity1.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_nationality"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::National.new(nil, nil, self)]
end
end

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

@ -0,0 +1,32 @@
class Form::Lettings::Pages::LeadTenantOverRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_over_retirement_value_check"
@depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }]
@title_text = {
"translation" => "soft_validations.retirement.max.title",
"arguments" => [
{
"key" => "retirement_age_for_person_1",
"label" => false,
"i18n_template" => "age",
},
],
}
@informative_text = {
"translation" => "soft_validations.retirement.max.hint_text",
"arguments" => [
{ "key" => "plural_gender_for_person_1", "label" => false, "i18n_template" => "gender" },
{
"key" => "retirement_age_for_person_1",
"label" => false,
"i18n_template" => "age",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::RetirementValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,32 @@
class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_under_retirement_value_check"
@depends_on = [{ "person_1_retired_under_soft_min_age?" => true }]
@title_text = {
"translation" => "soft_validations.retirement.min.title",
"arguments" => [
{
"key" => "retirement_age_for_person_1",
"label" => false,
"i18n_template" => "age",
},
],
}
@informative_text = {
"translation" => "soft_validations.retirement.min.hint_text",
"arguments" => [
{ "key" => "plural_gender_for_person_1", "label" => false, "i18n_template" => "gender" },
{
"key" => "retirement_age_for_person_1",
"label" => false,
"i18n_template" => "age",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::NoRetirementValueCheck.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/lead_tenant_working_situation.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::LeadTenantWorkingSituation < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "lead_tenant_working_situation"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::WorkingSituation1.new(nil, nil, self)]
end
end

10
app/models/form/lettings/pages/location.rb

@ -1,10 +1,12 @@
class Form::Lettings::Pages::Location < ::Form::Page
def initialize(_id, hsh, subsection)
super("location", hsh, subsection)
@depends_on = [{
"needstype" => 2,
"scheme_has_multiple_locations?" => true,
}]
@depends_on = [
{
"needstype" => 2,
"scheme_has_multiple_locations?" => true,
},
]
@next_unresolved_page_id = :check_answers
end

25
app/models/form/lettings/pages/max_rent_value_check.rb

@ -0,0 +1,25 @@
class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "max_rent_value_check"
@depends_on = [{ "rent_in_soft_max_range?" => true }]
@title_text = {
"translation" => "soft_validations.rent.max.title_text",
"arguments" => [{ "key" => "brent", "label" => true, "i18n_template" => "brent" }],
}
@informative_text = {
"translation" => "soft_validations.rent.max.hint_text",
"arguments" => [
{
"key" => "soft_max_for_period",
"label" => false,
"i18n_template" => "soft_max_for_period",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self)]
end
end

25
app/models/form/lettings/pages/min_rent_value_check.rb

@ -0,0 +1,25 @@
class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "min_rent_value_check"
@depends_on = [{ "rent_in_soft_min_range?" => true }]
@title_text = {
"translation" => "soft_validations.rent.min.title_text",
"arguments" => [{ "key" => "brent", "label" => true, "i18n_template" => "brent" }],
}
@informative_text = {
"translation" => "soft_validations.rent.min.hint_text",
"arguments" => [
{
"key" => "soft_min_for_period",
"label" => false,
"i18n_template" => "soft_min_for_period",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "net_income_value_check"
@depends_on = [{ "net_income_soft_validation_triggered?" => true }]
@title_text = { "translation" => "soft_validations.net_income.title_text" }
@informative_text = {
"translation" => "soft_validations.net_income.hint_text",
"arguments" => [
{ "key" => "ecstat1", "label" => true, "i18n_template" => "ecstat1" },
{ "key" => "earnings", "label" => true, "i18n_template" => "earnings" },
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::NetIncomeValueCheck.new(nil, nil, self)]
end
end

15
app/models/form/lettings/pages/new_build_handover_date.rb

@ -0,0 +1,15 @@
class Form::Lettings::Pages::NewBuildHandoverDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "new_build_handover_date"
@depends_on = [
{ "renewal" => 0, "rsnvac" => 15 },
{ "renewal" => 0, "rsnvac" => 16 },
{ "renewal" => 0, "rsnvac" => 17 },
]
end
def questions
@questions ||= [Form::Lettings::Questions::VoiddateNewBuild.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "no_females_pregnant_household_lead_age_value_check"
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.no_females",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "no_females_pregnant_household_lead_hhmemb_value_check"
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.no_females",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "no_females_pregnant_household_lead_value_check"
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.no_females",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "no_females_pregnant_household_person_#{person_index}_age_value_check"
@depends_on = [{ "no_females_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.no_females",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "no_females_pregnant_household_person_#{person_index}_value_check"
@depends_on = [{ "no_females_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.no_females",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,19 @@
class Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "no_females_pregnant_household_value_check"
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }]
@title_text = {
"translation" => "soft_validations.pregnancy.title",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
@informative_text = {
"translation" => "soft_validations.pregnancy.no_females",
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }],
}
end
def questions
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)]
end
end

16
app/models/form/lettings/pages/outstanding.rb

@ -0,0 +1,16 @@
class Form::Lettings::Pages::Outstanding < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "outstanding"
@depends_on = [
{ "hb" => 1, "household_charge" => 0 },
{ "hb" => 1, "household_charge" => nil },
{ "hb" => 6, "household_charge" => 0 },
{ "hb" => 6, "household_charge" => nil },
]
end
def questions
@questions ||= [Form::Lettings::Questions::Hbrentshortfall.new(nil, nil, self)]
end
end

14
app/models/form/lettings/pages/outstanding_amount.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::OutstandingAmount < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "outstanding_amount"
@depends_on = [{ "hb" => 1, "hbrentshortfall" => 1 }, { "hb" => 6, "hbrentshortfall" => 1 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::TshortfallKnown.new(nil, nil, self),
Form::Lettings::Questions::Tshortfall.new(nil, nil, self),
]
end
end

15
app/models/form/lettings/pages/person_age.rb

@ -0,0 +1,15 @@
class Form::Lettings::Pages::PersonAge < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_age"
@depends_on = [{ "details_known_#{person_index}" => 0 }]
@person_index = person_index
end
def questions
@questions ||= [
Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index),
Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index),
]
end
end

12
app/models/form/lettings/pages/person_gender_identity.rb

@ -0,0 +1,12 @@
class Form::Lettings::Pages::PersonGenderIdentity < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_gender_identity"
@depends_on = [{ "details_known_#{person_index}" => 0 }]
@person_index = person_index
end
def questions
@questions ||= [Form::Lettings::Questions::PersonGenderIdentity.new(nil, nil, self, person_index: @person_index)]
end
end

13
app/models/form/lettings/pages/person_known.rb

@ -0,0 +1,13 @@
class Form::Lettings::Pages::PersonKnown < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_known"
@header = "You’ve given us the details for #{person_index - 1} person in the household"
@depends_on = (person_index..8).map { |index| { "hhmemb" => index } }
@person_index = person_index
end
def questions
@questions ||= [Form::Lettings::Questions::DetailsKnown.new(nil, nil, self, person_index: @person_index)]
end
end

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

@ -0,0 +1,36 @@
class Form::Lettings::Pages::PersonOverRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_over_retirement_value_check"
@depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }]
@title_text = {
"translation" => "soft_validations.retirement.max.title",
"arguments" => [
{
"key" => "retirement_age_for_person_#{person_index}",
"label" => false,
"i18n_template" => "age",
},
],
}
@informative_text = {
"translation" => "soft_validations.retirement.max.hint_text",
"arguments" => [
{
"key" => "plural_gender_for_person_#{person_index}",
"label" => false,
"i18n_template" => "gender",
},
{
"key" => "retirement_age_for_person_#{person_index}",
"label" => false,
"i18n_template" => "age",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::RetirementValueCheck.new(nil, nil, self)]
end
end

12
app/models/form/lettings/pages/person_relationship_to_lead.rb

@ -0,0 +1,12 @@
class Form::Lettings::Pages::PersonRelationshipToLead < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_relationship_to_lead"
@depends_on = [{ "details_known_#{person_index}" => 0 }]
@person_index = person_index
end
def questions
@questions ||= [Form::Lettings::Questions::PersonRelationship.new(nil, nil, self, person_index: @person_index)]
end
end

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

@ -0,0 +1,36 @@
class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_under_retirement_value_check"
@depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }]
@title_text = {
"translation" => "soft_validations.retirement.min.title",
"arguments" => [
{
"key" => "retirement_age_for_person_#{person_index}",
"label" => false,
"i18n_template" => "age",
},
],
}
@informative_text = {
"translation" => "soft_validations.retirement.min.hint_text",
"arguments" => [
{
"key" => "plural_gender_for_person_#{person_index}",
"label" => false,
"i18n_template" => "gender",
},
{
"key" => "retirement_age_for_person_#{person_index}",
"label" => false,
"i18n_template" => "age",
},
],
}
end
def questions
@questions ||= [Form::Lettings::Questions::NoRetirementValueCheck.new(nil, nil, self)]
end
end

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

@ -0,0 +1,21 @@
class Form::Lettings::Pages::PersonWorkingSituation < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_working_situation"
@depends_on = [
{
"details_known_#{person_index}" => 0,
"age#{person_index}" => {
"operator" => ">",
"operand" => 15,
},
},
{ "details_known_#{person_index}" => 0, "age#{person_index}" => nil },
]
@person_index = person_index
end
def questions
@questions ||= [Form::Lettings::Questions::PersonWorkingSituation.new(nil, nil, self, person_index: @person_index)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::Pregnant < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::PregOcc.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PreviousHousingSituation < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_housing_situation"
@depends_on = [{ "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Prevten.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PreviousHousingSituationRenewal < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_housing_situation_renewal"
@depends_on = [{ "renewal" => 1, "needstype" => 2 }]
end
def questions
@questions ||= [Form::Lettings::Questions::PrevtenRenewal.new(nil, nil, self)]
end
end

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

@ -0,0 +1,14 @@
class Form::Lettings::Pages::PreviousLocalAuthority < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_local_authority"
@depends_on = [{ "is_previous_la_inferred" => false }]
end
def questions
@questions ||= [
Form::Lettings::Questions::PreviousLaKnown.new(nil, nil, self),
Form::Lettings::Questions::Prevloc.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,8 @@
class Form::Lettings::Pages::PreviousPostcode < ::Form::Page
def questions
@questions ||= [
Form::Lettings::Questions::Ppcodenk.new(nil, nil, self),
Form::Lettings::Questions::PpostcodeFull.new(nil, nil, self),
]
end
end

11
app/models/form/lettings/pages/property_building_type.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyBuildingType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_building_type"
@depends_on = [{ "needstype" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Builtype.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_let_type.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyLetType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_let_type"
@depends_on = [{ "first_time_property_let_as_social_housing" => 0, "renewal" => 0, "needstype" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Unitletas.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_local_authority"
@depends_on = [{ "is_la_inferred" => false, "needstype" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::La.new(nil, nil, self)]
end
end

25
app/models/form/lettings/pages/property_major_repairs.rb

@ -0,0 +1,25 @@
class Form::Lettings::Pages::PropertyMajorRepairs < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_major_repairs"
@depends_on = [
{ "renewal" => 0, "rsnvac" => 5 },
{ "renewal" => 0, "rsnvac" => 6 },
{ "renewal" => 0, "rsnvac" => 8 },
{ "renewal" => 0, "rsnvac" => 9 },
{ "renewal" => 0, "rsnvac" => 10 },
{ "renewal" => 0, "rsnvac" => 11 },
{ "renewal" => 0, "rsnvac" => 12 },
{ "renewal" => 0, "rsnvac" => 13 },
{ "renewal" => 0, "rsnvac" => 18 },
{ "renewal" => 0, "rsnvac" => 19 },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::Majorrepairs.new(nil, nil, self),
Form::Lettings::Questions::Mrcdate.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,13 @@
class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_major_repairs_value_check"
@depends_on = [{ "major_repairs_date_in_soft_range?" => true }]
@title_text = { "translation" => "soft_validations.major_repairs_date.title_text" }
@informative_text = {}
end
def questions
@questions ||= [Form::Lettings::Questions::MajorRepairsDateValueCheck.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_number_of_bedrooms.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyNumberOfBedrooms < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_number_of_bedrooms"
@depends_on = [{ "needstype" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Beds.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_number_of_times_relet_not_social_let.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyNumberOfTimesReletNotSocialLet < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_number_of_times_relet_not_social_let"
@depends_on = [{ "first_time_property_let_as_social_housing" => 0, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Offered.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_number_of_times_relet_social_let.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyNumberOfTimesReletSocialLet < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_number_of_times_relet_social_let"
@depends_on = [{ "first_time_property_let_as_social_housing" => 1, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::OfferedSocialLet.new(nil, nil, self)]
end
end

14
app/models/form/lettings/pages/property_postcode.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::PropertyPostcode < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_postcode"
@depends_on = [{ "needstype" => 1 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self),
Form::Lettings::Questions::PostcodeFull.new(nil, nil, self),
]
end
end

11
app/models/form/lettings/pages/property_unit_type.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyUnitType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_unit_type"
@depends_on = [{ "needstype" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::UnittypeGn.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_vacancy_reason_first_let.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyVacancyReasonFirstLet < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_vacancy_reason_first_let"
@depends_on = [{ "first_time_property_let_as_social_housing" => 1, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::RsnvacFirstLet.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_vacancy_reason_not_first_let.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_vacancy_reason_not_first_let"
@depends_on = [{ "first_time_property_let_as_social_housing" => 0, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Rsnvac.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/property_wheelchair_accessible.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::PropertyWheelchairAccessible < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_wheelchair_accessible"
@depends_on = [{ "needstype" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Wchair.new(nil, nil, self)]
end
end

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

@ -0,0 +1,14 @@
class Form::Lettings::Pages::ReasonForLeavingLastSettledHome < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "reason_for_leaving_last_settled_home"
@depends_on = [{ "renewal" => 0 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::Reason.new(nil, nil, self),
Form::Lettings::Questions::Reasonother.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "reason_for_leaving_last_settled_home_renewal"
@depends_on = [{ "renewal" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::ReasonRenewal.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::ReasonablePreference < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Reasonpref.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/reasonable_preference_reason.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ReasonablePreferenceReason < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "reasonable_preference_reason"
@depends_on = [{ "reasonpref" => 1 }]
end
def questions
@questions ||= [Form::Lettings::Questions::ReasonablePreferenceReason.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::Referral < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral"
@depends_on = [{ "managing_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ReferralPrp < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_prp"
@depends_on = [{ "managing_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::ReferralPrp.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_supported_housing"
@depends_on = [{ "managing_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::ReferralSupportedHousing.new(nil, nil, self)]
end
end

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

@ -0,0 +1,11 @@
class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_supported_housing_prp"
@depends_on = [{ "managing_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::ReferralSupportedHousingPrp.new(nil, nil, self)]
end
end

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

@ -0,0 +1,23 @@
class Form::Lettings::Pages::Rent4Weekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_4_weekly"
@header = "Household rent and charges"
@depends_on = [
{ "household_charge" => 0, "period" => 3, "is_carehome" => 0 },
{ "household_charge" => nil, "period" => 3, "is_carehome" => 0 },
{ "household_charge" => 0, "period" => 3, "is_carehome" => nil },
{ "household_charge" => nil, "period" => 3, "is_carehome" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::Brent4Weekly.new(nil, nil, self),
Form::Lettings::Questions::Scharge4Weekly.new(nil, nil, self),
Form::Lettings::Questions::Pscharge4Weekly.new(nil, nil, self),
Form::Lettings::Questions::Supcharg4Weekly.new(nil, nil, self),
Form::Lettings::Questions::Tcharge4Weekly.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,23 @@
class Form::Lettings::Pages::RentBiWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_bi_weekly"
@header = "Household rent and charges"
@depends_on = [
{ "household_charge" => 0, "period" => 2, "is_carehome" => 0 },
{ "household_charge" => nil, "period" => 2, "is_carehome" => 0 },
{ "household_charge" => 0, "period" => 2, "is_carehome" => nil },
{ "household_charge" => nil, "period" => 2, "is_carehome" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::BrentBiWeekly.new(nil, nil, self),
Form::Lettings::Questions::SchargeBiWeekly.new(nil, nil, self),
Form::Lettings::Questions::PschargeBiWeekly.new(nil, nil, self),
Form::Lettings::Questions::SupchargBiWeekly.new(nil, nil, self),
Form::Lettings::Questions::TchargeBiWeekly.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,23 @@
class Form::Lettings::Pages::RentMonthly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_monthly"
@header = "Household rent and charges"
@depends_on = [
{ "household_charge" => 0, "period" => 4, "is_carehome" => 0 },
{ "household_charge" => nil, "period" => 4, "is_carehome" => 0 },
{ "household_charge" => 0, "period" => 4, "is_carehome" => nil },
{ "household_charge" => nil, "period" => 4, "is_carehome" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::BrentMonthly.new(nil, nil, self),
Form::Lettings::Questions::SchargeMonthly.new(nil, nil, self),
Form::Lettings::Questions::PschargeMonthly.new(nil, nil, self),
Form::Lettings::Questions::SupchargMonthly.new(nil, nil, self),
Form::Lettings::Questions::TchargeMonthly.new(nil, nil, self),
]
end
end

11
app/models/form/lettings/pages/rent_or_other_charges.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::RentOrOtherCharges < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_or_other_charges"
@depends_on = [{ "needstype" => 2 }]
end
def questions
@questions ||= [Form::Lettings::Questions::HouseholdCharge.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/rent_period.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::RentPeriod < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_period"
@depends_on = [{ "household_charge" => 0 }, { "household_charge" => nil }]
end
def questions
@questions ||= [Form::Lettings::Questions::Period.new(nil, nil, self)]
end
end

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

@ -0,0 +1,43 @@
class Form::Lettings::Pages::RentWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_weekly"
@header = "Household rent and charges"
@depends_on = [
{ "period" => 1, "household_charge" => 0, "is_carehome" => 0 },
{ "period" => 1, "household_charge" => nil, "is_carehome" => 0 },
{ "period" => 5, "household_charge" => 0, "is_carehome" => 0 },
{ "period" => 5, "household_charge" => nil, "is_carehome" => 0 },
{ "period" => 6, "household_charge" => 0, "is_carehome" => 0 },
{ "period" => 6, "household_charge" => nil, "is_carehome" => 0 },
{ "period" => 7, "household_charge" => 0, "is_carehome" => 0 },
{ "period" => 7, "household_charge" => nil, "is_carehome" => 0 },
{ "period" => 8, "household_charge" => 0, "is_carehome" => 0 },
{ "period" => 8, "household_charge" => nil, "is_carehome" => 0 },
{ "period" => 9, "household_charge" => 0, "is_carehome" => 0 },
{ "period" => 9, "household_charge" => nil, "is_carehome" => 0 },
{ "period" => 1, "household_charge" => 0, "is_carehome" => nil },
{ "period" => 1, "household_charge" => nil, "is_carehome" => nil },
{ "period" => 5, "household_charge" => 0, "is_carehome" => nil },
{ "period" => 5, "household_charge" => nil, "is_carehome" => nil },
{ "period" => 6, "household_charge" => 0, "is_carehome" => nil },
{ "period" => 6, "household_charge" => nil, "is_carehome" => nil },
{ "period" => 7, "household_charge" => 0, "is_carehome" => nil },
{ "period" => 7, "household_charge" => nil, "is_carehome" => nil },
{ "period" => 8, "household_charge" => 0, "is_carehome" => nil },
{ "period" => 8, "household_charge" => nil, "is_carehome" => nil },
{ "period" => 9, "household_charge" => 0, "is_carehome" => nil },
{ "period" => 9, "household_charge" => nil, "is_carehome" => nil },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::BrentWeekly.new(nil, nil, self),
Form::Lettings::Questions::SchargeWeekly.new(nil, nil, self),
Form::Lettings::Questions::PschargeWeekly.new(nil, nil, self),
Form::Lettings::Questions::SupchargWeekly.new(nil, nil, self),
Form::Lettings::Questions::TchargeWeekly.new(nil, nil, self),
]
end
end

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

@ -1,9 +1,11 @@
class Form::Lettings::Pages::Scheme < ::Form::Page
def initialize(_id, hsh, subsection)
super("scheme", hsh, subsection)
@depends_on = [{
"needstype" => 2,
}]
@depends_on = [
{
"needstype" => 2,
},
]
@next_unresolved_page_id = "location"
end

11
app/models/form/lettings/pages/shelteredaccom.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::Shelteredaccom < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "shelteredaccom"
@depends_on = [{ "needstype" => 2 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Sheltered.new(nil, nil, self)]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::StarterTenancy < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Startertenancy.new(nil, nil, self)]
end
end

14
app/models/form/lettings/pages/starter_tenancy_type.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::StarterTenancyType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "starter_tenancy_type"
@depends_on = [{ "startertenancy" => 1 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::StarterTenancy.new(nil, nil, self),
Form::Lettings::Questions::Tenancyother.new(nil, nil, self),
]
end
end

11
app/models/form/lettings/pages/tenancy_length.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::TenancyLength < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "tenancy_length"
@depends_on = [{ "tenancy" => 4 }, { "tenancy" => 6 }, { "tenancy" => 3 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Tenancylength.new(nil, nil, self)]
end
end

14
app/models/form/lettings/pages/tenancy_type.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::TenancyType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "tenancy_type"
@depends_on = [{ "startertenancy" => 2 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::Tenancy.new(nil, nil, self),
Form::Lettings::Questions::Tenancyother.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,5 @@
class Form::Lettings::Pages::TimeLivedInLocalAuthority < ::Form::Page
def questions
@questions ||= [Form::Lettings::Questions::Layear.new(nil, nil, self)]
end
end

11
app/models/form/lettings/pages/time_on_waiting_list.rb

@ -0,0 +1,11 @@
class Form::Lettings::Pages::TimeOnWaitingList < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "time_on_waiting_list"
@depends_on = [{ "renewal" => 0 }]
end
def questions
@questions ||= [Form::Lettings::Questions::Waityear.new(nil, nil, self)]
end
end

15
app/models/form/lettings/pages/type_of_access_needs.rb

@ -0,0 +1,15 @@
class Form::Lettings::Pages::TypeOfAccessNeeds < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "type_of_access_needs"
@header = "Disabled access needs"
@depends_on = [{ "housingneeds" => 1 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::HousingneedsType.new(nil, nil, self),
Form::Lettings::Questions::HousingneedsOther.new(nil, nil, self),
]
end
end

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

@ -0,0 +1,13 @@
class Form::Lettings::Pages::VoidDateValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "void_date_value_check"
@depends_on = [{ "voiddate_in_soft_range?" => true }]
@title_text = { "translation" => "soft_validations.void_date.title_text" }
@informative_text = {}
end
def questions
@questions ||= [Form::Lettings::Questions::VoidDateValueCheck.new(nil, nil, self)]
end
end

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

Loading…
Cancel
Save