From c862423adfef26674469683de27523df05fe779c Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Thu, 16 Mar 2023 18:01:03 +0000 Subject: [PATCH] CLDC-1864 single log numbering (#1381) * feat: add initial question number behaviour * feat: add initial CYA behaviour * feat: number sales setup section * refactor: lint * feat: property information numbering * feat: household characteristics section and typo fix * feat: household characteristics numbering * feat: household situation numbering * feat: other household info numbering * feat: income, benefits and outgoings numbering * feat: shared ownership scheme numbering * feat: shared, discount and outright numbering * feat: fix income duplication bug, add numbers to other questions * feat: typo fix * feat: add lettings setup numbering * feat: add property info numbering * feat: add household char numbering * feat: add household needs numbering * feat: add household situ numbering * feat: add income numbering * feat: update tests * refactor: cleanup and disable on 2022 and before logs * feat: add test for q numbers in 23/24 year only * refactor: highlight multiplication in brackets * feat: show rent and charge questions individually on cya * feat: number new previous tenure q * feat: delete old prevten file * feat: update card numbers after merge * feat: add q60 ands 61 sales * refactor: delete empty files --------- Co-authored-by: Kat --- ...swers_summary_list_card_component.html.erb | 2 +- ...eck_answers_summary_list_card_component.rb | 4 + app/helpers/check_answers_helper.rb | 4 + app/helpers/question_view_helper.rb | 2 +- app/models/form/lettings/questions/age.rb | 1 + app/models/form/lettings/questions/age1.rb | 1 + .../form/lettings/questions/age1_known.rb | 1 + .../form/lettings/questions/age_known.rb | 1 + .../form/lettings/questions/armedforces.rb | 1 + app/models/form/lettings/questions/beds.rb | 1 + .../form/lettings/questions/benefits.rb | 1 + .../form/lettings/questions/brent_4_weekly.rb | 2 +- .../lettings/questions/brent_bi_weekly.rb | 2 +- .../form/lettings/questions/brent_monthly.rb | 2 +- .../form/lettings/questions/brent_weekly.rb | 2 +- .../form/lettings/questions/builtype.rb | 1 + .../lettings/questions/chcharge_4_weekly.rb | 1 + .../lettings/questions/chcharge_bi_weekly.rb | 1 + .../lettings/questions/chcharge_monthly.rb | 1 + .../lettings/questions/chcharge_weekly.rb | 1 + .../lettings/questions/condition_effects.rb | 1 + .../form/lettings/questions/declaration.rb | 3 +- .../form/lettings/questions/earnings.rb | 1 + .../form/lettings/questions/ethnic_arab.rb | 1 + .../form/lettings/questions/ethnic_asian.rb | 1 + .../form/lettings/questions/ethnic_black.rb | 1 + .../form/lettings/questions/ethnic_group.rb | 1 + .../form/lettings/questions/ethnic_mixed.rb | 1 + .../form/lettings/questions/ethnic_white.rb | 1 + ...rst_time_property_let_as_social_housing.rb | 1 + .../lettings/questions/gender_identity1.rb | 1 + app/models/form/lettings/questions/hb.rb | 1 + .../lettings/questions/hbrentshortfall.rb | 1 + app/models/form/lettings/questions/hhmemb.rb | 1 + .../form/lettings/questions/homeless.rb | 1 + .../lettings/questions/household_charge.rb | 1 + .../form/lettings/questions/housingneeds.rb | 1 + .../lettings/questions/housingneeds_other.rb | 1 + .../lettings/questions/housingneeds_type.rb | 1 + app/models/form/lettings/questions/illness.rb | 1 + app/models/form/lettings/questions/incfreq.rb | 1 + .../lettings/questions/irproduct_other.rb | 1 + .../form/lettings/questions/is_carehome.rb | 1 + app/models/form/lettings/questions/joint.rb | 1 + app/models/form/lettings/questions/la.rb | 1 + app/models/form/lettings/questions/layear.rb | 1 + app/models/form/lettings/questions/leftreg.rb | 1 + .../lettings/questions/letting_allocation.rb | 1 + .../form/lettings/questions/location_id.rb | 1 + .../form/lettings/questions/majorrepairs.rb | 1 + .../questions/managing_organisation.rb | 1 + app/models/form/lettings/questions/mrcdate.rb | 1 + .../form/lettings/questions/nationality.rb | 1 + .../form/lettings/questions/needs_type.rb | 1 + .../lettings/questions/net_income_known.rb | 1 + app/models/form/lettings/questions/offered.rb | 1 + .../lettings/questions/offered_social_let.rb | 1 + app/models/form/lettings/questions/period.rb | 1 + .../questions/person_gender_identity.rb | 1 + .../lettings/questions/person_relationship.rb | 1 + .../questions/person_working_situation.rb | 1 + .../form/lettings/questions/ppcodenk.rb | 1 + .../form/lettings/questions/ppostcode_full.rb | 1 + .../form/lettings/questions/preg_occ.rb | 1 + .../lettings/questions/previous_la_known.rb | 1 + .../lettings/questions/previous_let_type.rb | 1 + .../lettings/questions/previous_tenure.rb | 1 + .../questions/previous_tenure_renewal.rb | 1 + app/models/form/lettings/questions/prevloc.rb | 1 + .../lettings/questions/property_reference.rb | 1 + .../lettings/questions/pscharge_4_weekly.rb | 2 +- .../lettings/questions/pscharge_bi_weekly.rb | 2 +- .../lettings/questions/pscharge_monthly.rb | 2 +- .../lettings/questions/pscharge_weekly.rb | 2 +- app/models/form/lettings/questions/reason.rb | 1 + .../form/lettings/questions/reason_renewal.rb | 1 + .../questions/reasonable_preference_reason.rb | 1 + .../form/lettings/questions/reasonother.rb | 1 + .../form/lettings/questions/reasonpref.rb | 1 + .../form/lettings/questions/referral.rb | 1 + .../form/lettings/questions/referral_prp.rb | 1 + .../questions/referral_supported_housing.rb | 1 + .../referral_supported_housing_prp.rb | 1 + app/models/form/lettings/questions/renewal.rb | 1 + .../form/lettings/questions/rent_type.rb | 1 + .../form/lettings/questions/reservist.rb | 1 + app/models/form/lettings/questions/rsnvac.rb | 1 + .../lettings/questions/rsnvac_first_let.rb | 1 + .../lettings/questions/scharge_4_weekly.rb | 2 +- .../lettings/questions/scharge_bi_weekly.rb | 2 +- .../lettings/questions/scharge_monthly.rb | 2 +- .../form/lettings/questions/scharge_weekly.rb | 2 +- .../form/lettings/questions/scheme_id.rb | 1 + .../form/lettings/questions/sheltered.rb | 1 + .../questions/starter_tenancy_type.rb | 1 + .../form/lettings/questions/startertenancy.rb | 1 + .../form/lettings/questions/stock_owner.rb | 1 + .../lettings/questions/supcharg_4_weekly.rb | 2 +- .../lettings/questions/supcharg_bi_weekly.rb | 2 +- .../lettings/questions/supcharg_monthly.rb | 2 +- .../lettings/questions/supcharg_weekly.rb | 2 +- .../lettings/questions/tcharge_4_weekly.rb | 1 + .../lettings/questions/tcharge_bi_weekly.rb | 1 + .../lettings/questions/tcharge_monthly.rb | 1 + .../form/lettings/questions/tcharge_weekly.rb | 1 + .../form/lettings/questions/tenancy_length.rb | 1 + .../form/lettings/questions/tenancy_other.rb | 1 + .../lettings/questions/tenancy_start_date.rb | 1 + .../form/lettings/questions/tenancy_type.rb | 1 + .../form/lettings/questions/tenant_code.rb | 1 + .../form/lettings/questions/tshortfall.rb | 1 + .../lettings/questions/tshortfall_known.rb | 1 + .../form/lettings/questions/unittype_gn.rb | 1 + .../form/lettings/questions/voiddate.rb | 1 + .../lettings/questions/voiddate_new_build.rb | 1 + .../form/lettings/questions/waityear.rb | 1 + .../form/lettings/questions/wheelchair.rb | 1 + .../lettings/questions/working_situation1.rb | 1 + app/models/form/question.rb | 9 ++- .../pages/about_deposit_with_discount.rb | 2 +- .../pages/about_deposit_without_discount.rb | 7 +- .../form/sales/pages/about_price_not_rtb.rb | 2 +- .../form/sales/pages/about_price_rtb.rb | 2 +- .../form/sales/pages/extra_borrowing.rb | 7 +- .../form/sales/pages/leasehold_charges.rb | 9 ++- .../sales/pages/living_before_purchase.rb | 9 ++- .../form/sales/pages/mortgage_amount.rb | 7 +- .../form/sales/pages/mortgage_lender.rb | 7 +- .../form/sales/pages/mortgage_lender_other.rb | 7 +- .../form/sales/pages/mortgage_length.rb | 7 +- app/models/form/sales/pages/mortgageused.rb | 7 +- .../purchase_price_outright_ownership.rb | 7 +- app/models/form/sales/questions/age1.rb | 1 + app/models/form/sales/questions/age2.rb | 1 + .../form/sales/questions/armed_forces.rb | 1 + .../sales/questions/armed_forces_spouse.rb | 1 + .../form/sales/questions/buyer1_age_known.rb | 1 + .../buyer1_ethnic_background_arab.rb | 3 +- .../buyer1_ethnic_background_asian.rb | 3 +- .../buyer1_ethnic_background_black.rb | 3 +- .../buyer1_ethnic_background_mixed.rb | 3 +- .../buyer1_ethnic_background_white.rb | 3 +- .../sales/questions/buyer1_ethnic_group.rb | 1 + .../form/sales/questions/buyer1_income.rb | 1 + .../sales/questions/buyer1_income_known.rb | 10 ++- .../questions/buyer1_live_in_property.rb | 1 + .../form/sales/questions/buyer1_mortgage.rb | 1 + .../sales/questions/buyer1_previous_tenure.rb | 1 + .../questions/buyer1_working_situation.rb | 1 + .../form/sales/questions/buyer2_age_known.rb | 1 + .../buyer2_ethnic_background_arab.rb | 3 +- .../buyer2_ethnic_background_asian.rb | 3 +- .../buyer2_ethnic_background_black.rb | 3 +- .../buyer2_ethnic_background_mixed.rb | 3 +- .../buyer2_ethnic_background_white.rb | 3 +- .../sales/questions/buyer2_ethnic_group.rb | 1 + .../form/sales/questions/buyer2_income.rb | 1 + .../sales/questions/buyer2_income_known.rb | 10 ++- .../questions/buyer2_live_in_property.rb | 1 + .../form/sales/questions/buyer2_living_in.rb | 1 + .../form/sales/questions/buyer2_mortgage.rb | 1 + .../buyer2_relationship_to_buyer1.rb | 1 + .../questions/buyer2_working_situation.rb | 1 + .../form/sales/questions/buyer_company.rb | 1 + .../form/sales/questions/buyer_interview.rb | 1 + app/models/form/sales/questions/buyer_live.rb | 1 + .../form/sales/questions/buyer_previous.rb | 1 + .../sales/questions/buyer_still_serving.rb | 1 + .../sales/questions/buyers_organisations.rb | 1 + .../form/sales/questions/deposit_amount.rb | 17 +++- .../form/sales/questions/deposit_discount.rb | 1 + app/models/form/sales/questions/discount.rb | 1 + .../questions/discounted_ownership_type.rb | 1 + app/models/form/sales/questions/equity.rb | 1 + .../form/sales/questions/exchange_date.rb | 1 + .../form/sales/questions/extra_borrowing.rb | 17 +++- app/models/form/sales/questions/fromprop.rb | 1 + .../form/sales/questions/gender_identity1.rb | 1 + .../form/sales/questions/gender_identity2.rb | 1 + app/models/form/sales/questions/grant.rb | 3 +- .../form/sales/questions/handover_date.rb | 1 + .../sales/questions/household_disability.rb | 1 + .../sales/questions/household_wheelchair.rb | 1 + .../form/sales/questions/housing_benefits.rb | 1 + .../form/sales/questions/joint_purchase.rb | 1 + .../form/sales/questions/la_nominations.rb | 1 + .../form/sales/questions/leasehold_charges.rb | 17 +++- .../questions/leasehold_charges_known.rb | 17 +++- .../sales/questions/living_before_purchase.rb | 15 +++- .../questions/living_before_purchase_years.rb | 15 +++- .../form/sales/questions/monthly_rent.rb | 1 + .../form/sales/questions/mortgage_amount.rb | 17 +++- .../form/sales/questions/mortgage_lender.rb | 17 +++- .../sales/questions/mortgage_lender_other.rb | 17 +++- .../form/sales/questions/mortgage_length.rb | 17 +++- .../form/sales/questions/mortgageused.rb | 17 +++- .../form/sales/questions/nationality1.rb | 1 + .../sales/questions/number_joint_buyers.rb | 1 + .../questions/number_of_others_in_property.rb | 1 + .../sales/questions/other_ownership_type.rb | 1 + .../questions/outright_ownership_type.rb | 1 + .../form/sales/questions/ownership_scheme.rb | 1 + app/models/form/sales/questions/person_age.rb | 1 + .../form/sales/questions/person_age_known.rb | 1 + .../sales/questions/person_gender_identity.rb | 1 + .../person_relationship_to_buyer_1.rb | 1 + .../questions/person_working_situation.rb | 1 + .../form/sales/questions/previous_bedrooms.rb | 1 + .../form/sales/questions/previous_la_known.rb | 1 + .../form/sales/questions/previous_postcode.rb | 1 + .../questions/previous_postcode_known.rb | 1 + .../form/sales/questions/previous_tenure.rb | 1 + .../sales/questions/previous_tenure_buyer2.rb | 1 + app/models/form/sales/questions/prevloc.rb | 1 + app/models/form/sales/questions/prevown.rb | 1 + app/models/form/sales/questions/prevshared.rb | 1 + .../form/sales/questions/privacy_notice.rb | 1 + .../sales/questions/property_building_type.rb | 1 + .../questions/property_local_authority.rb | 1 + .../property_local_authority_known.rb | 1 + .../questions/property_number_of_bedrooms.rb | 1 + .../sales/questions/property_unit_type.rb | 1 + .../property_wheelchair_accessible.rb | 1 + .../form/sales/questions/purchase_price.rb | 15 +++- .../purchase_price_outright_ownership.rb | 12 --- .../form/sales/questions/purchaser_code.rb | 1 + app/models/form/sales/questions/resale.rb | 1 + app/models/form/sales/questions/sale_date.rb | 1 + app/models/form/sales/questions/savings.rb | 1 + app/models/form/sales/questions/savings_nk.rb | 1 + .../sales/questions/shared_ownership_type.rb | 1 + app/models/form/sales/questions/staircase.rb | 1 + .../form/sales/questions/staircase_bought.rb | 1 + .../form/sales/questions/staircase_owned.rb | 1 + .../form/sales/questions/staircase_sale.rb | 1 + app/models/form/sales/questions/value.rb | 1 + .../discounted_ownership_scheme.rb | 20 ++--- .../form/sales/subsections/outright_sale.rb | 18 ++--- .../subsections/shared_ownership_scheme.rb | 18 ++--- .../form/_check_answers_summary_list.html.erb | 2 +- ...nswers_summary_list_card_component_spec.rb | 77 ++++++++++++------- spec/helpers/question_view_helper_spec.rb | 10 ++- .../about_deposit_without_discount_spec.rb | 2 +- .../form/sales/pages/extra_borrowing_spec.rb | 2 +- .../sales/pages/leasehold_charges_spec.rb | 2 +- .../pages/living_before_purchase_spec.rb | 2 +- .../form/sales/pages/mortgage_amount_spec.rb | 2 +- .../sales/pages/mortgage_lender_other_spec.rb | 2 +- .../form/sales/pages/mortgage_lender_spec.rb | 2 +- .../form/sales/pages/mortgage_length_spec.rb | 2 +- .../form/sales/pages/mortgageused_spec.rb | 2 +- .../purchase_price_outright_ownership_spec.rb | 2 +- .../buyer1_ethnic_background_arab_spec.rb | 2 +- .../buyer1_ethnic_background_asian_spec.rb | 2 +- .../buyer1_ethnic_background_black_spec.rb | 2 +- .../buyer1_ethnic_background_mixed_spec.rb | 2 +- .../buyer1_ethnic_background_white_spec.rb | 2 +- .../questions/buyer1_income_known_spec.rb | 2 +- .../buyer2_ethnic_background_arab_spec.rb | 2 +- .../buyer2_ethnic_background_asian_spec.rb | 2 +- .../buyer2_ethnic_background_black_spec.rb | 2 +- .../buyer2_ethnic_background_mixed_spec.rb | 2 +- .../buyer2_ethnic_background_white_spec.rb | 2 +- .../questions/buyer2_income_known_spec.rb | 2 +- .../sales/questions/deposit_amount_spec.rb | 2 +- .../sales/questions/extra_borrowing_spec.rb | 2 +- .../models/form/sales/questions/grant_spec.rb | 2 +- .../questions/leasehold_charges_known_spec.rb | 2 +- .../sales/questions/leasehold_charges_spec.rb | 2 +- .../questions/living_before_purchase_spec.rb | 2 +- .../living_before_purchase_years_spec.rb | 2 +- .../sales/questions/mortgage_amount_spec.rb | 2 +- .../questions/mortgage_lender_other_spec.rb | 2 +- .../sales/questions/mortgage_lender_spec.rb | 2 +- .../sales/questions/mortgage_length_spec.rb | 2 +- .../form/sales/questions/mortgageused_spec.rb | 2 +- .../sales/questions/purchase_price_spec.rb | 2 +- .../discounted_ownership_scheme_spec.rb | 2 +- 278 files changed, 597 insertions(+), 194 deletions(-) delete mode 100644 app/models/form/sales/questions/purchase_price_outright_ownership.rb diff --git a/app/components/check_answers_summary_list_card_component.html.erb b/app/components/check_answers_summary_list_card_component.html.erb index e5b5388ab..3b4c4978a 100644 --- a/app/components/check_answers_summary_list_card_component.html.erb +++ b/app/components/check_answers_summary_list_card_component.html.erb @@ -10,7 +10,7 @@ <%= govuk_summary_list do |summary_list| %> <% applicable_questions.each do |question| %> <% summary_list.row do |row| %> - <% row.key { question.check_answer_label.to_s.presence || question.header.to_s } %> + <% row.key { get_question_label(question) } %> <% row.value do %> <%= get_answer_label(question) %> diff --git a/app/components/check_answers_summary_list_card_component.rb b/app/components/check_answers_summary_list_card_component.rb index e8ed971bc..62469e324 100644 --- a/app/components/check_answers_summary_list_card_component.rb +++ b/app/components/check_answers_summary_list_card_component.rb @@ -17,6 +17,10 @@ class CheckAnswersSummaryListCardComponent < ViewComponent::Base question.answer_label(log, user).presence || unanswered_value end + def get_question_label(question) + [question.question_number_string, question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ") + end + def check_answers_card_title(question) return "Lead tenant" if question.form.type == "lettings" && question.check_answers_card_number == 1 return "Buyer #{question.check_answers_card_number}" if question.check_answers_card_number <= number_of_buyers diff --git a/app/helpers/check_answers_helper.rb b/app/helpers/check_answers_helper.rb index 66a833859..a29ab98d0 100644 --- a/app/helpers/check_answers_helper.rb +++ b/app/helpers/check_answers_helper.rb @@ -45,4 +45,8 @@ private def get_answer_label(question, lettings_log) question.answer_label(lettings_log, current_user).presence || "You didn’t answer this question".html_safe end + + def get_question_label(question) + [question.question_number_string, question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ") + end end diff --git a/app/helpers/question_view_helper.rb b/app/helpers/question_view_helper.rb index fc308b835..d40b3cd35 100644 --- a/app/helpers/question_view_helper.rb +++ b/app/helpers/question_view_helper.rb @@ -7,7 +7,7 @@ module QuestionViewHelper def legend(question, page_header, conditional) { - text: question.header.html_safe, + text: [question.question_number_string(conditional:), question.header.html_safe].compact.join(" - "), size: label_size(page_header, conditional), tag: label_tag(page_header, conditional), } diff --git a/app/models/form/lettings/questions/age.rb b/app/models/form/lettings/questions/age.rb index 82975ebb7..6b76a6945 100644 --- a/app/models/form/lettings/questions/age.rb +++ b/app/models/form/lettings/questions/age.rb @@ -12,5 +12,6 @@ class Form::Lettings::Questions::Age < ::Form::Question @min = 1 @step = 1 @hint_text = "For a child under 1, enter 1" if person_type == "child" + @question_number = 31 + (4 * person_index) end end diff --git a/app/models/form/lettings/questions/age1.rb b/app/models/form/lettings/questions/age1.rb index 24512af28..2f43ac7ab 100644 --- a/app/models/form/lettings/questions/age1.rb +++ b/app/models/form/lettings/questions/age1.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::Age1 < ::Form::Question @max = 120 @min = 16 @step = 1 + @question_number = 32 end end diff --git a/app/models/form/lettings/questions/age1_known.rb b/app/models/form/lettings/questions/age1_known.rb index d9899eb12..aaf28e68a 100644 --- a/app/models/form/lettings/questions/age1_known.rb +++ b/app/models/form/lettings/questions/age1_known.rb @@ -10,6 +10,7 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "age1" => [0] } @hidden_in_check_answers = { "depends_on" => [{ "age1_known" => 0 }, { "age1_known" => 1 }] } + @question_number = 32 end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/age_known.rb b/app/models/form/lettings/questions/age_known.rb index b7682c769..9f9264e7d 100644 --- a/app/models/form/lettings/questions/age_known.rb +++ b/app/models/form/lettings/questions/age_known.rb @@ -15,6 +15,7 @@ class Form::Lettings::Questions::AgeKnown < ::Form::Question { "age#{person_index}_known" => 1 }, ], } + @question_number = 31 + (4 * person_index) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/armedforces.rb b/app/models/form/lettings/questions/armedforces.rb index b5e34d81d..fb9a02a64 100644 --- a/app/models/form/lettings/questions/armedforces.rb +++ b/app/models/form/lettings/questions/armedforces.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question @check_answers_card_number = 0 @hint_text = "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." @answer_options = ANSWER_OPTIONS + @question_number = 66 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/beds.rb b/app/models/form/lettings/questions/beds.rb index cc3ceb885..75d2a835d 100644 --- a/app/models/form/lettings/questions/beds.rb +++ b/app/models/form/lettings/questions/beds.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::Beds < ::Form::Question @min = 0 @hint_text = "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom." @step = 1 + @question_number = 22 end end diff --git a/app/models/form/lettings/questions/benefits.rb b/app/models/form/lettings/questions/benefits.rb index 27f90053d..3d23c50a1 100644 --- a/app/models/form/lettings/questions/benefits.rb +++ b/app/models/form/lettings/questions/benefits.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Benefits < ::Form::Question @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 = 90 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/brent_4_weekly.rb b/app/models/form/lettings/questions/brent_4_weekly.rb index c7659dbd4..6649b9a60 100644 --- a/app/models/form/lettings/questions/brent_4_weekly.rb +++ b/app/models/form/lettings/questions/brent_4_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 4 weeks" + @question_number = 95 end end diff --git a/app/models/form/lettings/questions/brent_bi_weekly.rb b/app/models/form/lettings/questions/brent_bi_weekly.rb index 7b1e1d04e..37f1bfa20 100644 --- a/app/models/form/lettings/questions/brent_bi_weekly.rb +++ b/app/models/form/lettings/questions/brent_bi_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 2 weeks" + @question_number = 95 end end diff --git a/app/models/form/lettings/questions/brent_monthly.rb b/app/models/form/lettings/questions/brent_monthly.rb index c58a21175..e38a490b0 100644 --- a/app/models/form/lettings/questions/brent_monthly.rb +++ b/app/models/form/lettings/questions/brent_monthly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every month" + @question_number = 95 end end diff --git a/app/models/form/lettings/questions/brent_weekly.rb b/app/models/form/lettings/questions/brent_weekly.rb index 0ea1f5359..7a8adfc7a 100644 --- a/app/models/form/lettings/questions/brent_weekly.rb +++ b/app/models/form/lettings/questions/brent_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every week" + @question_number = 95 end end diff --git a/app/models/form/lettings/questions/builtype.rb b/app/models/form/lettings/questions/builtype.rb index 087699e0d..9cda5649f 100644 --- a/app/models/form/lettings/questions/builtype.rb +++ b/app/models/form/lettings/questions/builtype.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Builtype < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 20 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/chcharge_4_weekly.rb b/app/models/form/lettings/questions/chcharge_4_weekly.rb index c755a933b..6e0923cc0 100644 --- a/app/models/form/lettings/questions/chcharge_4_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_4_weekly.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::Chcharge4Weekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every 4 weeks" + @question_number = 94 end end diff --git a/app/models/form/lettings/questions/chcharge_bi_weekly.rb b/app/models/form/lettings/questions/chcharge_bi_weekly.rb index e65dc59a1..273ec7ac0 100644 --- a/app/models/form/lettings/questions/chcharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_bi_weekly.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::ChchargeBiWeekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every 2 weeks" + @question_number = 94 end end diff --git a/app/models/form/lettings/questions/chcharge_monthly.rb b/app/models/form/lettings/questions/chcharge_monthly.rb index f0bc7bb82..ab2da34ad 100644 --- a/app/models/form/lettings/questions/chcharge_monthly.rb +++ b/app/models/form/lettings/questions/chcharge_monthly.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::ChchargeMonthly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every month" + @question_number = 94 end end diff --git a/app/models/form/lettings/questions/chcharge_weekly.rb b/app/models/form/lettings/questions/chcharge_weekly.rb index 874259215..96b8de324 100644 --- a/app/models/form/lettings/questions/chcharge_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_weekly.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::ChchargeWeekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every week" + @question_number = 94 end end diff --git a/app/models/form/lettings/questions/condition_effects.rb b/app/models/form/lettings/questions/condition_effects.rb index f89cfb3f2..c8240f232 100644 --- a/app/models/form/lettings/questions/condition_effects.rb +++ b/app/models/form/lettings/questions/condition_effects.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question @check_answers_card_number = 0 @hint_text = "Select all that apply." @answer_options = ANSWER_OPTIONS + @question_number = 74 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index a342fba6d..742545b96 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -3,11 +3,12 @@ class Form::Lettings::Questions::Declaration < ::Form::Question super @id = "declaration" @check_answer_label = "Tenant has seen the privacy notice" - @header = "" + @header = "Declaration" @type = "checkbox" @check_answers_card_number = 0 @guidance_partial = "privacy_notice_tenant" @answer_options = ANSWER_OPTIONS + @question_number = 30 end ANSWER_OPTIONS = { "declaration" => { "value" => "The tenant has seen the DLUHC privacy notice" } }.freeze diff --git a/app/models/form/lettings/questions/earnings.rb b/app/models/form/lettings/questions/earnings.rb index 2647d0179..445710f09 100644 --- a/app/models/form/lettings/questions/earnings.rb +++ b/app/models/form/lettings/questions/earnings.rb @@ -17,5 +17,6 @@ class Form::Lettings::Questions::Earnings < ::Form::Question { "label" => " every month", "depends_on" => { "incfreq" => 2 } }, { "label" => " every year", "depends_on" => { "incfreq" => 3 } }, ] + @question_number = 88 end end diff --git a/app/models/form/lettings/questions/ethnic_arab.rb b/app/models/form/lettings/questions/ethnic_arab.rb index 28b3591da..9884b69f0 100644 --- a/app/models/form/lettings/questions/ethnic_arab.rb +++ b/app/models/form/lettings/questions/ethnic_arab.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 35 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/ethnic_asian.rb b/app/models/form/lettings/questions/ethnic_asian.rb index 96b8df9b5..17aa29d44 100644 --- a/app/models/form/lettings/questions/ethnic_asian.rb +++ b/app/models/form/lettings/questions/ethnic_asian.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 35 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/ethnic_black.rb b/app/models/form/lettings/questions/ethnic_black.rb index 68beca8ad..c6f0c81d5 100644 --- a/app/models/form/lettings/questions/ethnic_black.rb +++ b/app/models/form/lettings/questions/ethnic_black.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 35 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/ethnic_group.rb b/app/models/form/lettings/questions/ethnic_group.rb index 4f7364296..f9e392089 100644 --- a/app/models/form/lettings/questions/ethnic_group.rb +++ b/app/models/form/lettings/questions/ethnic_group.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 34 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/ethnic_mixed.rb b/app/models/form/lettings/questions/ethnic_mixed.rb index 6160e40a5..ac059837d 100644 --- a/app/models/form/lettings/questions/ethnic_mixed.rb +++ b/app/models/form/lettings/questions/ethnic_mixed.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 35 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb index 993237a44..707330175 100644 --- a/app/models/form/lettings/questions/ethnic_white.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 35 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb index 62f0bba19..132eca0c2 100644 --- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb +++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 14 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/gender_identity1.rb b/app/models/form/lettings/questions/gender_identity1.rb index 2f5c8f45e..769dc1850 100644 --- a/app/models/form/lettings/questions/gender_identity1.rb +++ b/app/models/form/lettings/questions/gender_identity1.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 33 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/hb.rb b/app/models/form/lettings/questions/hb.rb index e8da0e146..68dfc987b 100644 --- a/app/models/form/lettings/questions/hb.rb +++ b/app/models/form/lettings/questions/hb.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Hb < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 89 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/hbrentshortfall.rb b/app/models/form/lettings/questions/hbrentshortfall.rb index 687ac3aeb..828c36377 100644 --- a/app/models/form/lettings/questions/hbrentshortfall.rb +++ b/app/models/form/lettings/questions/hbrentshortfall.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question @check_answers_card_number = 0 @hint_text = "Also known as the ‘outstanding amount’." @answer_options = ANSWER_OPTIONS + @question_number = 99 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/hhmemb.rb b/app/models/form/lettings/questions/hhmemb.rb index 3c6e6c3af..fee0aced3 100644 --- a/app/models/form/lettings/questions/hhmemb.rb +++ b/app/models/form/lettings/questions/hhmemb.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question @min = 1 @hint_text = "You can provide details for a maximum of 8 people." @step = 1 + @question_number = 31 end end diff --git a/app/models/form/lettings/questions/homeless.rb b/app/models/form/lettings/questions/homeless.rb index fcfc117d2..21a597a00 100644 --- a/app/models/form/lettings/questions/homeless.rb +++ b/app/models/form/lettings/questions/homeless.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Homeless < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 79 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/household_charge.rb b/app/models/form/lettings/questions/household_charge.rb index 1a8ade65a..da77cb361 100644 --- a/app/models/form/lettings/questions/household_charge.rb +++ b/app/models/form/lettings/questions/household_charge.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::HouseholdCharge < ::Form::Question @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 = 91 end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/housingneeds.rb b/app/models/form/lettings/questions/housingneeds.rb index cd8a3275d..5b6775eec 100644 --- a/app/models/form/lettings/questions/housingneeds.rb +++ b/app/models/form/lettings/questions/housingneeds.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 70 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index 18d544ca9..fd1b463a0 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 72 end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/housingneeds_type.rb b/app/models/form/lettings/questions/housingneeds_type.rb index a06f28705..49a03e73d 100644 --- a/app/models/form/lettings/questions/housingneeds_type.rb +++ b/app/models/form/lettings/questions/housingneeds_type.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 71 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/illness.rb b/app/models/form/lettings/questions/illness.rb index d2a3b09dd..6a54c6a46 100644 --- a/app/models/form/lettings/questions/illness.rb +++ b/app/models/form/lettings/questions/illness.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Illness < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 73 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/incfreq.rb b/app/models/form/lettings/questions/incfreq.rb index 0d347c0da..c31f23fd5 100644 --- a/app/models/form/lettings/questions/incfreq.rb +++ b/app/models/form/lettings/questions/incfreq.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question @hint_text = "" @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = true + @question_number = 87 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/irproduct_other.rb b/app/models/form/lettings/questions/irproduct_other.rb index 99945ceea..be21c3d27 100644 --- a/app/models/form/lettings/questions/irproduct_other.rb +++ b/app/models/form/lettings/questions/irproduct_other.rb @@ -5,5 +5,6 @@ class Form::Lettings::Questions::IrproductOther < ::Form::Question @check_answer_label = "Product name" @header = "Name of rent product" @type = "text" + @question_number = 6 end end diff --git a/app/models/form/lettings/questions/is_carehome.rb b/app/models/form/lettings/questions/is_carehome.rb index 6f17acc0d..9011d35bb 100644 --- a/app/models/form/lettings/questions/is_carehome.rb +++ b/app/models/form/lettings/questions/is_carehome.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question @hint_text = "" @answer_options = ANSWER_OPTIONS @conditional_for = { "chcharge" => [1] } + @question_number = 93 end ANSWER_OPTIONS = { "0" => { "value" => "No" }, "1" => { "value" => "Yes" } }.freeze diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index 484678f2b..7b1d9c2c9 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Joint < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 25 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index adafad4b9..3cafda054 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::La < ::Form::Question @type = "select" @check_answers_card_number = 0 @hint_text = "" + @question_number = 13 end def answer_options diff --git a/app/models/form/lettings/questions/layear.rb b/app/models/form/lettings/questions/layear.rb index 14a334399..764253250 100644 --- a/app/models/form/lettings/questions/layear.rb +++ b/app/models/form/lettings/questions/layear.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 75 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/leftreg.rb b/app/models/form/lettings/questions/leftreg.rb index 2601f351d..a6edecbc3 100644 --- a/app/models/form/lettings/questions/leftreg.rb +++ b/app/models/form/lettings/questions/leftreg.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 67 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb index e41f52b09..18c0a3042 100644 --- a/app/models/form/lettings/questions/letting_allocation.rb +++ b/app/models/form/lettings/questions/letting_allocation.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question @check_answers_card_number = 0 @hint_text = "Select all that apply." @answer_options = ANSWER_OPTIONS + @question_number = 84 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/location_id.rb b/app/models/form/lettings/questions/location_id.rb index fc197cf82..ee97724b5 100644 --- a/app/models/form/lettings/questions/location_id.rb +++ b/app/models/form/lettings/questions/location_id.rb @@ -10,6 +10,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question "needstype": 2, }, } + @question_number = 10 end def answer_options diff --git a/app/models/form/lettings/questions/majorrepairs.rb b/app/models/form/lettings/questions/majorrepairs.rb index e0a6fdb01..83acf76a6 100644 --- a/app/models/form/lettings/questions/majorrepairs.rb +++ b/app/models/form/lettings/questions/majorrepairs.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question @hint_text = "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs." @answer_options = ANSWER_OPTIONS @conditional_for = { "mrcdate" => [1] } + @question_number = 24 end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/managing_organisation.rb b/app/models/form/lettings/questions/managing_organisation.rb index bd9cbb8b9..7e4d318fe 100644 --- a/app/models/form/lettings/questions/managing_organisation.rb +++ b/app/models/form/lettings/questions/managing_organisation.rb @@ -5,6 +5,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question @check_answer_label = "Managing agent" @header = "Which organisation manages this letting?" @type = "select" + @question_number = 2 end def answer_options(log = nil, user = nil) diff --git a/app/models/form/lettings/questions/mrcdate.rb b/app/models/form/lettings/questions/mrcdate.rb index a3718af47..cadcd3a7a 100644 --- a/app/models/form/lettings/questions/mrcdate.rb +++ b/app/models/form/lettings/questions/mrcdate.rb @@ -7,5 +7,6 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question @type = "date" @check_answers_card_number = 0 @hint_text = "For example, 27 3 2021." + @question_number = 24 end end diff --git a/app/models/form/lettings/questions/nationality.rb b/app/models/form/lettings/questions/nationality.rb index 019c8a4fa..c86f93b09 100644 --- a/app/models/form/lettings/questions/nationality.rb +++ b/app/models/form/lettings/questions/nationality.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Nationality < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 36 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/needs_type.rb b/app/models/form/lettings/questions/needs_type.rb index 331899821..eaa13cb9d 100644 --- a/app/models/form/lettings/questions/needs_type.rb +++ b/app/models/form/lettings/questions/needs_type.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question @hint_text = "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 3 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/net_income_known.rb b/app/models/form/lettings/questions/net_income_known.rb index 760c20b9f..226569b9e 100644 --- a/app/models/form/lettings/questions/net_income_known.rb +++ b/app/models/form/lettings/questions/net_income_known.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question @guidance_partial = "what_counts_as_income" @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 86 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/offered.rb b/app/models/form/lettings/questions/offered.rb index e9491ba3c..e41def301 100644 --- a/app/models/form/lettings/questions/offered.rb +++ b/app/models/form/lettings/questions/offered.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::Offered < ::Form::Question @min = 0 @hint_text = I18n.t("hints.offered") @step = 1 + @question_number = 18 end end diff --git a/app/models/form/lettings/questions/offered_social_let.rb b/app/models/form/lettings/questions/offered_social_let.rb index 2178ef626..d3ac29516 100644 --- a/app/models/form/lettings/questions/offered_social_let.rb +++ b/app/models/form/lettings/questions/offered_social_let.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::OfferedSocialLet < ::Form::Question @min = 0 @hint_text = I18n.t("hints.offered") @step = 1 + @question_number = 18 end end diff --git a/app/models/form/lettings/questions/period.rb b/app/models/form/lettings/questions/period.rb index cf0b4d13a..08a8510c4 100644 --- a/app/models/form/lettings/questions/period.rb +++ b/app/models/form/lettings/questions/period.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Period < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 92 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/person_gender_identity.rb b/app/models/form/lettings/questions/person_gender_identity.rb index cb8f04ef2..1416a3414 100644 --- a/app/models/form/lettings/questions/person_gender_identity.rb +++ b/app/models/form/lettings/questions/person_gender_identity.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question @check_answers_card_number = person_index @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 32 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb index a346cf3cc..0d54db949 100644 --- a/app/models/form/lettings/questions/person_relationship.rb +++ b/app/models/form/lettings/questions/person_relationship.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question @check_answers_card_number = person_index @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 30 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/person_working_situation.rb b/app/models/form/lettings/questions/person_working_situation.rb index 9174930a2..d6e593e33 100644 --- a/app/models/form/lettings/questions/person_working_situation.rb +++ b/app/models/form/lettings/questions/person_working_situation.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question @check_answers_card_number = person_index @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 33 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/ppcodenk.rb b/app/models/form/lettings/questions/ppcodenk.rb index fa10f3d69..33b03d959 100644 --- a/app/models/form/lettings/questions/ppcodenk.rb +++ b/app/models/form/lettings/questions/ppcodenk.rb @@ -10,6 +10,7 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "ppostcode_full" => [1] } @hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] } + @question_number = 80 end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/ppostcode_full.rb b/app/models/form/lettings/questions/ppostcode_full.rb index 736e06f16..0432d1b5b 100644 --- a/app/models/form/lettings/questions/ppostcode_full.rb +++ b/app/models/form/lettings/questions/ppostcode_full.rb @@ -10,5 +10,6 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } } + @question_number = 80 end end diff --git a/app/models/form/lettings/questions/preg_occ.rb b/app/models/form/lettings/questions/preg_occ.rb index c6b6f168f..8a863a870 100644 --- a/app/models/form/lettings/questions/preg_occ.rb +++ b/app/models/form/lettings/questions/preg_occ.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 69 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/previous_la_known.rb b/app/models/form/lettings/questions/previous_la_known.rb index 0f563b62a..a9ff11e55 100644 --- a/app/models/form/lettings/questions/previous_la_known.rb +++ b/app/models/form/lettings/questions/previous_la_known.rb @@ -10,6 +10,7 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "prevloc" => [1] } @hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] } + @question_number = 81 end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index c685140e6..6c9947743 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 16 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/previous_tenure.rb b/app/models/form/lettings/questions/previous_tenure.rb index c100c3ddd..ca5b8d832 100644 --- a/app/models/form/lettings/questions/previous_tenure.rb +++ b/app/models/form/lettings/questions/previous_tenure.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question @check_answers_card_number = 0 @hint_text = "This is where the household was the night before they moved." @answer_options = ANSWER_OPTIONS + @question_number = 78 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/previous_tenure_renewal.rb b/app/models/form/lettings/questions/previous_tenure_renewal.rb index 6e2722b4f..56be9a95d 100644 --- a/app/models/form/lettings/questions/previous_tenure_renewal.rb +++ b/app/models/form/lettings/questions/previous_tenure_renewal.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 78 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/prevloc.rb b/app/models/form/lettings/questions/prevloc.rb index 06d23eed4..229af2c18 100644 --- a/app/models/form/lettings/questions/prevloc.rb +++ b/app/models/form/lettings/questions/prevloc.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question @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 = 81 end def answer_options diff --git a/app/models/form/lettings/questions/property_reference.rb b/app/models/form/lettings/questions/property_reference.rb index 75168f1bd..f93a57cee 100644 --- a/app/models/form/lettings/questions/property_reference.rb +++ b/app/models/form/lettings/questions/property_reference.rb @@ -7,5 +7,6 @@ class Form::Lettings::Questions::PropertyReference < ::Form::Question @hint_text = "This is how you usually refer to this property on your own systems." @type = "text" @width = 10 + @question_number = 8 end end diff --git a/app/models/form/lettings/questions/pscharge_4_weekly.rb b/app/models/form/lettings/questions/pscharge_4_weekly.rb index 2242cd692..cb716abd2 100644 --- a/app/models/form/lettings/questions/pscharge_4_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_4_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 4 weeks" + @question_number = 97 end end diff --git a/app/models/form/lettings/questions/pscharge_bi_weekly.rb b/app/models/form/lettings/questions/pscharge_bi_weekly.rb index 7a7c89443..bd3524b10 100644 --- a/app/models/form/lettings/questions/pscharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_bi_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 2 weeks" + @question_number = 97 end end diff --git a/app/models/form/lettings/questions/pscharge_monthly.rb b/app/models/form/lettings/questions/pscharge_monthly.rb index 6aa1ae911..bae5bd459 100644 --- a/app/models/form/lettings/questions/pscharge_monthly.rb +++ b/app/models/form/lettings/questions/pscharge_monthly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every month" + @question_number = 97 end end diff --git a/app/models/form/lettings/questions/pscharge_weekly.rb b/app/models/form/lettings/questions/pscharge_weekly.rb index 73f3d9323..1b24e9a10 100644 --- a/app/models/form/lettings/questions/pscharge_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every week" + @question_number = 97 end end diff --git a/app/models/form/lettings/questions/reason.rb b/app/models/form/lettings/questions/reason.rb index ef8fbcd0d..9598780ec 100644 --- a/app/models/form/lettings/questions/reason.rb +++ b/app/models/form/lettings/questions/reason.rb @@ -13,6 +13,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question 20, ], } + @question_number = 77 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb index c3a825c5e..9111ad8e7 100644 --- a/app/models/form/lettings/questions/reason_renewal.rb +++ b/app/models/form/lettings/questions/reason_renewal.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 77 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/reasonable_preference_reason.rb b/app/models/form/lettings/questions/reasonable_preference_reason.rb index f582ccadf..631949685 100644 --- a/app/models/form/lettings/questions/reasonable_preference_reason.rb +++ b/app/models/form/lettings/questions/reasonable_preference_reason.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question @check_answers_card_number = 0 @hint_text = "Select all that apply." @answer_options = ANSWER_OPTIONS + @question_number = 83 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/reasonother.rb b/app/models/form/lettings/questions/reasonother.rb index 48306f7d7..e045c9aa3 100644 --- a/app/models/form/lettings/questions/reasonother.rb +++ b/app/models/form/lettings/questions/reasonother.rb @@ -7,5 +7,6 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question @type = "text" @check_answers_card_number = 0 @hint_text = "" + @question_number = 77 end end diff --git a/app/models/form/lettings/questions/reasonpref.rb b/app/models/form/lettings/questions/reasonpref.rb index 571a7e3eb..43631a2fd 100644 --- a/app/models/form/lettings/questions/reasonpref.rb +++ b/app/models/form/lettings/questions/reasonpref.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question @check_answers_card_number = 0 @hint_text = "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority." @answer_options = ANSWER_OPTIONS + @question_number = 82 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/referral.rb b/app/models/form/lettings/questions/referral.rb index 83e5d3ae2..ca1e117a4 100644 --- a/app/models/form/lettings/questions/referral.rb +++ b/app/models/form/lettings/questions/referral.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Referral < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 85 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb index 5651f431f..a602beea8 100644 --- a/app/models/form/lettings/questions/referral_prp.rb +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 85 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb index 5b286d94d..12d24cd53 100644 --- a/app/models/form/lettings/questions/referral_supported_housing.rb +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 85 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb index 051f7b90b..4824dd6c5 100644 --- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 85 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/renewal.rb b/app/models/form/lettings/questions/renewal.rb index edf9c1e7b..ac9eca622 100644 --- a/app/models/form/lettings/questions/renewal.rb +++ b/app/models/form/lettings/questions/renewal.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::Renewal < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "A renewal is a letting to the same tenant in the same property" + @question_number = 4 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index 64e2839e2..ac9164f0c 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { "irproduct_other" => [5] } + @question_number = 6 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/reservist.rb b/app/models/form/lettings/questions/reservist.rb index 695254c05..44eb8219d 100644 --- a/app/models/form/lettings/questions/reservist.rb +++ b/app/models/form/lettings/questions/reservist.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Reservist < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 68 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 2899a9463..22d039748 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 17 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/rsnvac_first_let.rb b/app/models/form/lettings/questions/rsnvac_first_let.rb index a97e743db..8d7da0433 100644 --- a/app/models/form/lettings/questions/rsnvac_first_let.rb +++ b/app/models/form/lettings/questions/rsnvac_first_let.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 15 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/scharge_4_weekly.rb b/app/models/form/lettings/questions/scharge_4_weekly.rb index 418c88157..b13c8339b 100644 --- a/app/models/form/lettings/questions/scharge_4_weekly.rb +++ b/app/models/form/lettings/questions/scharge_4_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 4 weeks" + @question_number = 96 end end diff --git a/app/models/form/lettings/questions/scharge_bi_weekly.rb b/app/models/form/lettings/questions/scharge_bi_weekly.rb index 913f49844..679662e64 100644 --- a/app/models/form/lettings/questions/scharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/scharge_bi_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 2 weeks" + @question_number = 96 end end diff --git a/app/models/form/lettings/questions/scharge_monthly.rb b/app/models/form/lettings/questions/scharge_monthly.rb index bec02543c..74f35578c 100644 --- a/app/models/form/lettings/questions/scharge_monthly.rb +++ b/app/models/form/lettings/questions/scharge_monthly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every month" + @question_number = 96 end end diff --git a/app/models/form/lettings/questions/scharge_weekly.rb b/app/models/form/lettings/questions/scharge_weekly.rb index 11e79c111..c8788b7bd 100644 --- a/app/models/form/lettings/questions/scharge_weekly.rb +++ b/app/models/form/lettings/questions/scharge_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every week" + @question_number = 96 end end diff --git a/app/models/form/lettings/questions/scheme_id.rb b/app/models/form/lettings/questions/scheme_id.rb index 3f8225caa..a9147ba5f 100644 --- a/app/models/form/lettings/questions/scheme_id.rb +++ b/app/models/form/lettings/questions/scheme_id.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question @answer_options = answer_options @guidance_position = GuidancePosition::BOTTOM @guidance_partial = "scheme_selection" + @question_number = 9 end def answer_options diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index a5b289ffc..67da39ce5 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 29 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index 13fa20ef6..08fc8e56d 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question @hint_text = "This is also known as an ‘introductory period’." @answer_options = ANSWER_OPTIONS @conditional_for = { "tenancyother" => [3] } + @question_number = 27 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/startertenancy.rb b/app/models/form/lettings/questions/startertenancy.rb index 8ae35bb02..10f5946d3 100644 --- a/app/models/form/lettings/questions/startertenancy.rb +++ b/app/models/form/lettings/questions/startertenancy.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 26 end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/stock_owner.rb b/app/models/form/lettings/questions/stock_owner.rb index 531341739..3835838c5 100644 --- a/app/models/form/lettings/questions/stock_owner.rb +++ b/app/models/form/lettings/questions/stock_owner.rb @@ -5,6 +5,7 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question @check_answer_label = "Stock owner" @header = "Which organisation owns this property?" @type = "select" + @question_number = 1 end def answer_options(log = nil, user = nil) diff --git a/app/models/form/lettings/questions/supcharg_4_weekly.rb b/app/models/form/lettings/questions/supcharg_4_weekly.rb index 5540b3555..1ca7da652 100644 --- a/app/models/form/lettings/questions/supcharg_4_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 4 weeks" + @question_number = 98 end end diff --git a/app/models/form/lettings/questions/supcharg_bi_weekly.rb b/app/models/form/lettings/questions/supcharg_bi_weekly.rb index cbda5e5c9..07150f6f0 100644 --- a/app/models/form/lettings/questions/supcharg_bi_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every 2 weeks" + @question_number = 98 end end diff --git a/app/models/form/lettings/questions/supcharg_monthly.rb b/app/models/form/lettings/questions/supcharg_monthly.rb index 6b799f547..224ddc31c 100644 --- a/app/models/form/lettings/questions/supcharg_monthly.rb +++ b/app/models/form/lettings/questions/supcharg_monthly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every month" + @question_number = 98 end end diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb index 6f843db94..4e0c99057 100644 --- a/app/models/form/lettings/questions/supcharg_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_weekly.rb @@ -12,8 +12,8 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question @step = 0.01 @fields_to_add = %w[brent scharge pscharge supcharg] @result_field = "tcharge" - @hidden_in_check_answers = true @prefix = "£" @suffix = " every week" + @question_number = 98 end end diff --git a/app/models/form/lettings/questions/tcharge_4_weekly.rb b/app/models/form/lettings/questions/tcharge_4_weekly.rb index 7438f8527..3a353efe8 100644 --- a/app/models/form/lettings/questions/tcharge_4_weekly.rb +++ b/app/models/form/lettings/questions/tcharge_4_weekly.rb @@ -15,5 +15,6 @@ class Form::Lettings::Questions::Tcharge4Weekly < ::Form::Question @suffix = " every 4 weeks" @requires_js = true @fields_added = %w[brent scharge pscharge supcharg] + @hidden_in_check_answers = true end end diff --git a/app/models/form/lettings/questions/tcharge_bi_weekly.rb b/app/models/form/lettings/questions/tcharge_bi_weekly.rb index 1dee6f2bb..42fd9398b 100644 --- a/app/models/form/lettings/questions/tcharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/tcharge_bi_weekly.rb @@ -15,5 +15,6 @@ class Form::Lettings::Questions::TchargeBiWeekly < ::Form::Question @suffix = " every 2 weeks" @requires_js = true @fields_added = %w[brent scharge pscharge supcharg] + @hidden_in_check_answers = true end end diff --git a/app/models/form/lettings/questions/tcharge_monthly.rb b/app/models/form/lettings/questions/tcharge_monthly.rb index dc67c3351..3fcabdace 100644 --- a/app/models/form/lettings/questions/tcharge_monthly.rb +++ b/app/models/form/lettings/questions/tcharge_monthly.rb @@ -15,5 +15,6 @@ class Form::Lettings::Questions::TchargeMonthly < ::Form::Question @suffix = " every month" @requires_js = true @fields_added = %w[brent scharge pscharge supcharg] + @hidden_in_check_answers = true end end diff --git a/app/models/form/lettings/questions/tcharge_weekly.rb b/app/models/form/lettings/questions/tcharge_weekly.rb index 03fb8e4e2..d1ac7cb34 100644 --- a/app/models/form/lettings/questions/tcharge_weekly.rb +++ b/app/models/form/lettings/questions/tcharge_weekly.rb @@ -15,5 +15,6 @@ class Form::Lettings::Questions::TchargeWeekly < ::Form::Question @suffix = " every week" @requires_js = true @fields_added = %w[brent scharge pscharge supcharg] + @hidden_in_check_answers = true end end diff --git a/app/models/form/lettings/questions/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index 0a8088c51..90b34aa62 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -11,5 +11,6 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question @min = 0 @hint_text = "Don’t include the starter or introductory period." @step = 1 + @question_number = 28 end end diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index 6eea47ac8..c19b03703 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -7,5 +7,6 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question @type = "text" @check_answers_card_number = 0 @hint_text = "" + @question_number = 27 end end diff --git a/app/models/form/lettings/questions/tenancy_start_date.rb b/app/models/form/lettings/questions/tenancy_start_date.rb index b50021597..fd9d63cec 100644 --- a/app/models/form/lettings/questions/tenancy_start_date.rb +++ b/app/models/form/lettings/questions/tenancy_start_date.rb @@ -6,5 +6,6 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question @header = "What is the tenancy start date?" @type = "date" @unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct." + @question_number = 5 end end diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index c05b4349d..95beffbca 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question @hint_text = "" @answer_options = ANSWER_OPTIONS @conditional_for = { "tenancyother" => [3] } + @question_number = 27 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/tenant_code.rb b/app/models/form/lettings/questions/tenant_code.rb index 1872ebe8e..f51d33c46 100644 --- a/app/models/form/lettings/questions/tenant_code.rb +++ b/app/models/form/lettings/questions/tenant_code.rb @@ -7,5 +7,6 @@ class Form::Lettings::Questions::TenantCode < ::Form::Question @hint_text = "This is how you usually refer to this tenancy on your own systems." @type = "text" @width = 10 + @question_number = 7 end end diff --git a/app/models/form/lettings/questions/tshortfall.rb b/app/models/form/lettings/questions/tshortfall.rb index ca88f3e81..af8d32c9c 100644 --- a/app/models/form/lettings/questions/tshortfall.rb +++ b/app/models/form/lettings/questions/tshortfall.rb @@ -21,5 +21,6 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question { "label" => " every week for 46 weeks", "depends_on" => { "period" => 9 } }, { "label" => " every week for 52 weeks", "depends_on" => { "period" => 1 } }, ] + @question_number = 100 end end diff --git a/app/models/form/lettings/questions/tshortfall_known.rb b/app/models/form/lettings/questions/tshortfall_known.rb index 4f934d75a..7082af4f3 100644 --- a/app/models/form/lettings/questions/tshortfall_known.rb +++ b/app/models/form/lettings/questions/tshortfall_known.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question @hint_text = "You only need to give an approximate figure." @answer_options = ANSWER_OPTIONS @conditional_for = { "tshortfall" => [0] } + @question_number = 100 end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/unittype_gn.rb b/app/models/form/lettings/questions/unittype_gn.rb index 82f582722..01f38b0b9 100644 --- a/app/models/form/lettings/questions/unittype_gn.rb +++ b/app/models/form/lettings/questions/unittype_gn.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 19 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/voiddate.rb b/app/models/form/lettings/questions/voiddate.rb index 78e57c1ee..a91ac6ddb 100644 --- a/app/models/form/lettings/questions/voiddate.rb +++ b/app/models/form/lettings/questions/voiddate.rb @@ -6,5 +6,6 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question @header = "What is the void or renewal date?" @type = "date" @check_answers_card_number = 0 + @question_number = 23 end end diff --git a/app/models/form/lettings/questions/voiddate_new_build.rb b/app/models/form/lettings/questions/voiddate_new_build.rb index 9cda12522..dcf1326b0 100644 --- a/app/models/form/lettings/questions/voiddate_new_build.rb +++ b/app/models/form/lettings/questions/voiddate_new_build.rb @@ -7,5 +7,6 @@ class Form::Lettings::Questions::VoiddateNewBuild < ::Form::Question @type = "date" @check_answers_card_number = 0 @hint_text = "" + @question_number = 23 end end diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb index 74239b775..569533a9d 100644 --- a/app/models/form/lettings/questions/waityear.rb +++ b/app/models/form/lettings/questions/waityear.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Waityear < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 76 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/wheelchair.rb b/app/models/form/lettings/questions/wheelchair.rb index a841c9b66..3ba4f081f 100644 --- a/app/models/form/lettings/questions/wheelchair.rb +++ b/app/models/form/lettings/questions/wheelchair.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question @check_answers_card_number = 0 @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 21 end ANSWER_OPTIONS = { diff --git a/app/models/form/lettings/questions/working_situation1.rb b/app/models/form/lettings/questions/working_situation1.rb index 20f5dc984..4975b4125 100644 --- a/app/models/form/lettings/questions/working_situation1.rb +++ b/app/models/form/lettings/questions/working_situation1.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question @check_answers_card_number = 1 @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS + @question_number = 37 end ANSWER_OPTIONS = { diff --git a/app/models/form/question.rb b/app/models/form/question.rb index fffa0059e..9ddacd68b 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -4,7 +4,7 @@ class Form::Question :conditional_for, :readonly, :answer_options, :page, :check_answer_label, :inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value, :guidance_partial, :prefix, :suffix, :requires_js, :fields_added, :derived, - :check_answers_card_number, :unresolved_hint_text + :check_answers_card_number, :unresolved_hint_text, :question_number module GuidancePosition TOP = 1 @@ -40,6 +40,7 @@ class Form::Question @fields_added = hsh["fields_added"] @check_answers_card_number = hsh["check_answers_card_number"] || 0 @unresolved_hint_text = hsh["unresolved_hint_text"] + @question_number = hsh["question_number"] end end @@ -258,6 +259,12 @@ class Form::Question selected_answer_option_is_derived?(log) || has_inferred_check_answers_value?(log) end + def question_number_string(conditional: false) + if @question_number && !conditional && form.start_date.year >= 2023 + "Q#{@question_number}" + end + end + private def selected_answer_option_is_derived?(log) diff --git a/app/models/form/sales/pages/about_deposit_with_discount.rb b/app/models/form/sales/pages/about_deposit_with_discount.rb index 6a4a54071..1c684b0bc 100644 --- a/app/models/form/sales/pages/about_deposit_with_discount.rb +++ b/app/models/form/sales/pages/about_deposit_with_discount.rb @@ -8,7 +8,7 @@ class Form::Sales::Pages::AboutDepositWithDiscount < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::DepositAmount.new(nil, nil, self), + Form::Sales::Questions::DepositAmount.new(nil, nil, self, ownershipsch: 1), Form::Sales::Questions::DepositDiscount.new(nil, nil, self), ] end diff --git a/app/models/form/sales/pages/about_deposit_without_discount.rb b/app/models/form/sales/pages/about_deposit_without_discount.rb index e8e387eba..1114b8f84 100644 --- a/app/models/form/sales/pages/about_deposit_without_discount.rb +++ b/app/models/form/sales/pages/about_deposit_without_discount.rb @@ -1,15 +1,16 @@ class Form::Sales::Pages::AboutDepositWithoutDiscount < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @header = "About the deposit" @depends_on = [{ "is_type_discount?" => false, "ownershipsch" => 1 }, { "ownershipsch" => 2 }, { "ownershipsch" => 3, "mortgageused" => 1 }] + @ownershipsch = ownershipsch end def questions @questions ||= [ - Form::Sales::Questions::DepositAmount.new(nil, nil, self), + Form::Sales::Questions::DepositAmount.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/about_price_not_rtb.rb b/app/models/form/sales/pages/about_price_not_rtb.rb index c69b9a890..2f30548c7 100644 --- a/app/models/form/sales/pages/about_price_not_rtb.rb +++ b/app/models/form/sales/pages/about_price_not_rtb.rb @@ -11,7 +11,7 @@ class Form::Sales::Pages::AboutPriceNotRtb < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::PurchasePrice.new(nil, nil, self), + Form::Sales::Questions::PurchasePrice.new(nil, nil, self, ownershipsch: 2), Form::Sales::Questions::Grant.new(nil, nil, self), ] end diff --git a/app/models/form/sales/pages/about_price_rtb.rb b/app/models/form/sales/pages/about_price_rtb.rb index 35696e966..d8d20398f 100644 --- a/app/models/form/sales/pages/about_price_rtb.rb +++ b/app/models/form/sales/pages/about_price_rtb.rb @@ -10,7 +10,7 @@ class Form::Sales::Pages::AboutPriceRtb < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::PurchasePrice.new(nil, nil, self), + Form::Sales::Questions::PurchasePrice.new(nil, nil, self, ownershipsch: 2), Form::Sales::Questions::Discount.new(nil, nil, self), ] end diff --git a/app/models/form/sales/pages/extra_borrowing.rb b/app/models/form/sales/pages/extra_borrowing.rb index 7fb8b08a4..4bb8d0530 100644 --- a/app/models/form/sales/pages/extra_borrowing.rb +++ b/app/models/form/sales/pages/extra_borrowing.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::ExtraBorrowing < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch @header = "" @description = "" @subsection = subsection @@ -11,7 +12,7 @@ class Form::Sales::Pages::ExtraBorrowing < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::ExtraBorrowing.new(nil, nil, self), + Form::Sales::Questions::ExtraBorrowing.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/leasehold_charges.rb b/app/models/form/sales/pages/leasehold_charges.rb index 93382cf18..a27c25e1d 100644 --- a/app/models/form/sales/pages/leasehold_charges.rb +++ b/app/models/form/sales/pages/leasehold_charges.rb @@ -1,8 +1,13 @@ class Form::Sales::Pages::LeaseholdCharges < ::Form::Page + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch + end + def questions @questions ||= [ - Form::Sales::Questions::LeaseholdChargesKnown.new(nil, nil, self), - Form::Sales::Questions::LeaseholdCharges.new(nil, nil, self), + Form::Sales::Questions::LeaseholdChargesKnown.new(nil, nil, self, ownershipsch: @ownershipsch), + Form::Sales::Questions::LeaseholdCharges.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/living_before_purchase.rb b/app/models/form/sales/pages/living_before_purchase.rb index ac61ab1de..205b75e66 100644 --- a/app/models/form/sales/pages/living_before_purchase.rb +++ b/app/models/form/sales/pages/living_before_purchase.rb @@ -1,14 +1,19 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch + end + def questions @questions ||= [ living_before_purchase, - Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self), + Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch), ].compact end def living_before_purchase if form.start_date.year >= 2023 - Form::Sales::Questions::LivingBeforePurchase.new(nil, nil, self) + Form::Sales::Questions::LivingBeforePurchase.new(nil, nil, self, ownershipsch: @ownershipsch) end end end diff --git a/app/models/form/sales/pages/mortgage_amount.rb b/app/models/form/sales/pages/mortgage_amount.rb index 153c3bbe6..793570b46 100644 --- a/app/models/form/sales/pages/mortgage_amount.rb +++ b/app/models/form/sales/pages/mortgage_amount.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch @header = "Mortgage Amount" @depends_on = [{ "mortgageused" => 1, @@ -9,7 +10,7 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::MortgageAmount.new(nil, nil, self), + Form::Sales::Questions::MortgageAmount.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/mortgage_lender.rb b/app/models/form/sales/pages/mortgage_lender.rb index 552d7abf8..f187815b1 100644 --- a/app/models/form/sales/pages/mortgage_lender.rb +++ b/app/models/form/sales/pages/mortgage_lender.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::MortgageLender < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch @header = "" @description = "" @subsection = subsection @@ -11,7 +12,7 @@ class Form::Sales::Pages::MortgageLender < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::MortgageLender.new(nil, nil, self), + Form::Sales::Questions::MortgageLender.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/mortgage_lender_other.rb b/app/models/form/sales/pages/mortgage_lender_other.rb index a4f6aaf90..903a7dba8 100644 --- a/app/models/form/sales/pages/mortgage_lender_other.rb +++ b/app/models/form/sales/pages/mortgage_lender_other.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::MortgageLenderOther < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch @header = "" @description = "" @subsection = subsection @@ -11,7 +12,7 @@ class Form::Sales::Pages::MortgageLenderOther < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::MortgageLenderOther.new(nil, nil, self), + Form::Sales::Questions::MortgageLenderOther.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/mortgage_length.rb b/app/models/form/sales/pages/mortgage_length.rb index 979369bdd..dbc01a695 100644 --- a/app/models/form/sales/pages/mortgage_length.rb +++ b/app/models/form/sales/pages/mortgage_length.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch @depends_on = [{ "mortgageused" => 1, }] @@ -8,7 +9,7 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page def questions @questions ||= [ - Form::Sales::Questions::MortgageLength.new(nil, nil, self), + Form::Sales::Questions::MortgageLength.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/mortgageused.rb b/app/models/form/sales/pages/mortgageused.rb index 4a22c480e..f9d8eae2e 100644 --- a/app/models/form/sales/pages/mortgageused.rb +++ b/app/models/form/sales/pages/mortgageused.rb @@ -1,7 +1,12 @@ class Form::Sales::Pages::Mortgageused < ::Form::Page + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) + @ownershipsch = ownershipsch + end + def questions @questions ||= [ - Form::Sales::Questions::Mortgageused.new(nil, nil, self), + Form::Sales::Questions::Mortgageused.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/pages/purchase_price_outright_ownership.rb b/app/models/form/sales/pages/purchase_price_outright_ownership.rb index 6bf044d01..a5e995ed6 100644 --- a/app/models/form/sales/pages/purchase_price_outright_ownership.rb +++ b/app/models/form/sales/pages/purchase_price_outright_ownership.rb @@ -1,14 +1,15 @@ class Form::Sales::Pages::PurchasePriceOutrightOwnership < ::Form::Page - def initialize(id, hsh, subsection) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @depends_on = [ { "outright_sale_or_discounted_with_full_ownership?" => true }, ] + @ownershipsch = ownershipsch end def questions @questions ||= [ - Form::Sales::Questions::PurchasePriceOutrightOwnership.new(nil, nil, self), + Form::Sales::Questions::PurchasePrice.new(nil, nil, self, ownershipsch: @ownershipsch), ] end end diff --git a/app/models/form/sales/questions/age1.rb b/app/models/form/sales/questions/age1.rb index 94d40100f..d32083b53 100644 --- a/app/models/form/sales/questions/age1.rb +++ b/app/models/form/sales/questions/age1.rb @@ -19,5 +19,6 @@ class Form::Sales::Questions::Age1 < ::Form::Question @check_answers_card_number = 1 @min = 16 @max = 110 + @question_number = 20 end end diff --git a/app/models/form/sales/questions/age2.rb b/app/models/form/sales/questions/age2.rb index 9ba347ec8..c0dc567a1 100644 --- a/app/models/form/sales/questions/age2.rb +++ b/app/models/form/sales/questions/age2.rb @@ -13,5 +13,6 @@ class Form::Sales::Questions::Age2 < ::Form::Question @check_answers_card_number = 2 @max = 110 @min = 0 + @question_number = 28 end end diff --git a/app/models/form/sales/questions/armed_forces.rb b/app/models/form/sales/questions/armed_forces.rb index af003c5b2..3d5aa5621 100644 --- a/app/models/form/sales/questions/armed_forces.rb +++ b/app/models/form/sales/questions/armed_forces.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::ArmedForces < ::Form::Question @type = "radio" @hint_text = "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces" @answer_options = ANSWER_OPTIONS + @question_number = 62 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/armed_forces_spouse.rb b/app/models/form/sales/questions/armed_forces_spouse.rb index cf38bd434..f6857d6b7 100644 --- a/app/models/form/sales/questions/armed_forces_spouse.rb +++ b/app/models/form/sales/questions/armed_forces_spouse.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::ArmedForcesSpouse < ::Form::Question @header = "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 64 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_age_known.rb b/app/models/form/sales/questions/buyer1_age_known.rb index 761bacddb..566ae8f7d 100644 --- a/app/models/form/sales/questions/buyer1_age_known.rb +++ b/app/models/form/sales/questions/buyer1_age_known.rb @@ -24,6 +24,7 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question ], } @check_answers_card_number = 1 + @question_number = 20 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb b/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb index 19526f5b7..5b603deda 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb @@ -3,11 +3,12 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundArab < ::Form::Question super @id = "ethnic" @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes the buyer 1’s Arab background?" + @header = "Which of the following best describes buyer 1’s Arab background?" @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @question_number = 23 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb b/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb index ee910c054..4e851edd3 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb @@ -3,11 +3,12 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundAsian < ::Form::Question super @id = "ethnic" @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes the buyer 1’s Asian or Asian British background?" + @header = "Which of the following best describes buyer 1’s Asian or Asian British background?" @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @question_number = 23 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_black.rb b/app/models/form/sales/questions/buyer1_ethnic_background_black.rb index 4c24f1433..16e341a5a 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_black.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_black.rb @@ -3,11 +3,12 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundBlack < ::Form::Question super @id = "ethnic" @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes the buyer 1’s Black, African, Caribbean or Black British background?" + @header = "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?" @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @question_number = 23 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb b/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb index 8fa879949..b35a4563f 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb @@ -3,11 +3,12 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundMixed < ::Form::Question super @id = "ethnic" @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes the buyer 1’s Mixed or Multiple ethnic groups background?" + @header = "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?" @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @question_number = 23 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb index 4b7ec9182..644839979 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb @@ -3,11 +3,12 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question super @id = "ethnic" @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes the buyer 1’s White background?" + @header = "Which of the following best describes buyer 1’s White background?" @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @question_number = 23 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_ethnic_group.rb b/app/models/form/sales/questions/buyer1_ethnic_group.rb index ab151d84d..c33641b73 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_group.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_group.rb @@ -14,6 +14,7 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question "value" => "Prefers not to say", }] @check_answers_card_number = 1 + @question_number = 22 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_income.rb b/app/models/form/sales/questions/buyer1_income.rb index 43451af50..089747d8e 100644 --- a/app/models/form/sales/questions/buyer1_income.rb +++ b/app/models/form/sales/questions/buyer1_income.rb @@ -12,5 +12,6 @@ class Form::Sales::Questions::Buyer1Income < ::Form::Question @width = 5 @prefix = "£" @check_answers_card_number = 1 + @question_number = 67 end end diff --git a/app/models/form/sales/questions/buyer1_income_known.rb b/app/models/form/sales/questions/buyer1_income_known.rb index 64462fa59..b5fb9e1f1 100644 --- a/app/models/form/sales/questions/buyer1_income_known.rb +++ b/app/models/form/sales/questions/buyer1_income_known.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "income1nk" - @check_answer_label = "Buyer 1’s gross annual income" + @check_answer_label = "Buyer 1’s gross annual income known?" @header = "Do you know buyer 1’s annual income?" @type = "radio" @answer_options = ANSWER_OPTIONS @@ -10,6 +10,14 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question "income1" => [0], } @check_answers_card_number = 1 + @question_number = 67 + @hidden_in_check_answers = { + "depends_on" => [ + { + "income1nk" => 0, + }, + ], + } end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_live_in_property.rb b/app/models/form/sales/questions/buyer1_live_in_property.rb index 4f18f60df..72c269fc9 100644 --- a/app/models/form/sales/questions/buyer1_live_in_property.rb +++ b/app/models/form/sales/questions/buyer1_live_in_property.rb @@ -8,6 +8,7 @@ class Form::Sales::Questions::Buyer1LiveInProperty < ::Form::Question @answer_options = ANSWER_OPTIONS @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 + @question_number = 26 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_mortgage.rb b/app/models/form/sales/questions/buyer1_mortgage.rb index baaf00d4c..6db5a699f 100644 --- a/app/models/form/sales/questions/buyer1_mortgage.rb +++ b/app/models/form/sales/questions/buyer1_mortgage.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Buyer1Mortgage < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 1 + @question_number = 68 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer1_previous_tenure.rb b/app/models/form/sales/questions/buyer1_previous_tenure.rb index 2795cee2b..6341bee8f 100644 --- a/app/models/form/sales/questions/buyer1_previous_tenure.rb +++ b/app/models/form/sales/questions/buyer1_previous_tenure.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question @header = "What was buyer 1’s previous tenure?" @type = "radio" @answer_options = answer_options + @question_number = 56 end def answer_options diff --git a/app/models/form/sales/questions/buyer1_working_situation.rb b/app/models/form/sales/questions/buyer1_working_situation.rb index 79db1790b..8d88e2422 100644 --- a/app/models/form/sales/questions/buyer1_working_situation.rb +++ b/app/models/form/sales/questions/buyer1_working_situation.rb @@ -14,6 +14,7 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 25 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_age_known.rb b/app/models/form/sales/questions/buyer2_age_known.rb index c100d0b67..c71123452 100644 --- a/app/models/form/sales/questions/buyer2_age_known.rb +++ b/app/models/form/sales/questions/buyer2_age_known.rb @@ -20,6 +20,7 @@ class Form::Sales::Questions::Buyer2AgeKnown < ::Form::Question ], } @check_answers_card_number = 2 + @question_number = 28 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb b/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb index 1766780b7..d2c590c0a 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb @@ -3,10 +3,11 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundArab < ::Form::Question super @id = "ethnicbuy2" @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes the buyer 2’s Arab background?" + @header = "Which of the following best describes buyer 2’s Arab background?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 31 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb b/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb index 2578d220a..e74d5a4ba 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb @@ -3,10 +3,11 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question super @id = "ethnicbuy2" @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes the buyer 2’s Asian or Asian British background?" + @header = "Which of the following best describes buyer 2’s Asian or Asian British background?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 31 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_black.rb b/app/models/form/sales/questions/buyer2_ethnic_background_black.rb index 11d47790c..8442e9431 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_black.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_black.rb @@ -3,10 +3,11 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question super @id = "ethnicbuy2" @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes the buyer 2’s Black, African, Caribbean or Black British background?" + @header = "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 31 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb b/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb index 78600af34..a610644ef 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb @@ -3,10 +3,11 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question super @id = "ethnicbuy2" @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes the buyer 2’s Mixed or Multiple ethnic groups background?" + @header = "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 31 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb index 5b5fc8e2c..1500072e1 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb @@ -3,10 +3,11 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question super @id = "ethnicbuy2" @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes the buyer 2’s White background?" + @header = "Which of the following best describes buyer 2’s White background?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 31 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_group.rb b/app/models/form/sales/questions/buyer2_ethnic_group.rb index 5366910fe..dd0ab8866 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_group.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_group.rb @@ -13,6 +13,7 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question "value" => "Prefers not to say", }] @check_answers_card_number = 2 + @question_number = 30 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_income.rb b/app/models/form/sales/questions/buyer2_income.rb index f7d96720b..8cc0cd288 100644 --- a/app/models/form/sales/questions/buyer2_income.rb +++ b/app/models/form/sales/questions/buyer2_income.rb @@ -12,5 +12,6 @@ class Form::Sales::Questions::Buyer2Income < ::Form::Question @width = 5 @prefix = "£" @check_answers_card_number = 2 + @question_number = 69 end end diff --git a/app/models/form/sales/questions/buyer2_income_known.rb b/app/models/form/sales/questions/buyer2_income_known.rb index 0b4613809..7409383fa 100644 --- a/app/models/form/sales/questions/buyer2_income_known.rb +++ b/app/models/form/sales/questions/buyer2_income_known.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "income2nk" - @check_answer_label = "Buyer 2’s gross annual income" + @check_answer_label = "Buyer 2’s gross annual income known?" @header = "Do you know buyer 2’s annual income?" @type = "radio" @answer_options = ANSWER_OPTIONS @@ -10,6 +10,14 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question "income2" => [0], } @check_answers_card_number = 2 + @question_number = 69 + @hidden_in_check_answers = { + "depends_on" => [ + { + "income2nk" => 0, + }, + ], + } end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_live_in_property.rb b/app/models/form/sales/questions/buyer2_live_in_property.rb index 162627905..367a434b4 100644 --- a/app/models/form/sales/questions/buyer2_live_in_property.rb +++ b/app/models/form/sales/questions/buyer2_live_in_property.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Buyer2LiveInProperty < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 34 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_living_in.rb b/app/models/form/sales/questions/buyer2_living_in.rb index 1494e61a2..9440e1370 100644 --- a/app/models/form/sales/questions/buyer2_living_in.rb +++ b/app/models/form/sales/questions/buyer2_living_in.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question @type = "radio" @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 60 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_mortgage.rb b/app/models/form/sales/questions/buyer2_mortgage.rb index 884137df1..9c0ef029f 100644 --- a/app/models/form/sales/questions/buyer2_mortgage.rb +++ b/app/models/form/sales/questions/buyer2_mortgage.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Buyer2Mortgage < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 + @question_number = 70 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb index 678219be8..2d5ed8427 100644 --- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb @@ -13,6 +13,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 27 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer2_working_situation.rb b/app/models/form/sales/questions/buyer2_working_situation.rb index 21c68b456..9cd82cd68 100644 --- a/app/models/form/sales/questions/buyer2_working_situation.rb +++ b/app/models/form/sales/questions/buyer2_working_situation.rb @@ -13,6 +13,7 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 33 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer_company.rb b/app/models/form/sales/questions/buyer_company.rb index 1dac995b0..55a84019a 100644 --- a/app/models/form/sales/questions/buyer_company.rb +++ b/app/models/form/sales/questions/buyer_company.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question @header = "Is the buyer a company?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 7 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer_interview.rb b/app/models/form/sales/questions/buyer_interview.rb index b157c05cc..aa737171f 100644 --- a/app/models/form/sales/questions/buyer_interview.rb +++ b/app/models/form/sales/questions/buyer_interview.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question @type = "radio" @hint_text = "You should still try to answer all questions even if the buyer wasn't interviewed in person" @answer_options = ANSWER_OPTIONS + @question_number = 18 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer_live.rb b/app/models/form/sales/questions/buyer_live.rb index a8aeb0401..ee0a79611 100644 --- a/app/models/form/sales/questions/buyer_live.rb +++ b/app/models/form/sales/questions/buyer_live.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::BuyerLive < ::Form::Question @header = "Will the buyers live in the property?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 8 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer_previous.rb b/app/models/form/sales/questions/buyer_previous.rb index 15fe330f0..4a851a487 100644 --- a/app/models/form/sales/questions/buyer_previous.rb +++ b/app/models/form/sales/questions/buyer_previous.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question @header = I18n.t("questions.soctenant", count: joint_purchase ? 2 : 1) @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 84 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyer_still_serving.rb b/app/models/form/sales/questions/buyer_still_serving.rb index 04929fb42..75a525d1b 100644 --- a/app/models/form/sales/questions/buyer_still_serving.rb +++ b/app/models/form/sales/questions/buyer_still_serving.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::BuyerStillServing < ::Form::Question @header = "Is the buyer still serving in the UK armed forces?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 63 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/buyers_organisations.rb b/app/models/form/sales/questions/buyers_organisations.rb index ec76aebcd..1ab8a81e8 100644 --- a/app/models/form/sales/questions/buyers_organisations.rb +++ b/app/models/form/sales/questions/buyers_organisations.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question @type = "checkbox" @hint_text = "Select all that apply" @answer_options = ANSWER_OPTIONS + @question_number = 59 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/deposit_amount.rb b/app/models/form/sales/questions/deposit_amount.rb index e4fd4ceb2..fb6c0e563 100644 --- a/app/models/form/sales/questions/deposit_amount.rb +++ b/app/models/form/sales/questions/deposit_amount.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "deposit" @check_answer_label = "Cash deposit" @header = "How much cash deposit was paid on the property?" @@ -11,9 +11,22 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question @prefix = "£" @hint_text = "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage" @derived = true + @ownershipsch = ownershipsch + @question_number = question_number end def selected_answer_option_is_derived?(_log) true end + + def question_number + case @ownershipsch + when 1 + 95 + when 2 + 108 + when 3 + 116 + end + end end diff --git a/app/models/form/sales/questions/deposit_discount.rb b/app/models/form/sales/questions/deposit_discount.rb index b23a3e1b4..577da5a91 100644 --- a/app/models/form/sales/questions/deposit_discount.rb +++ b/app/models/form/sales/questions/deposit_discount.rb @@ -10,5 +10,6 @@ class Form::Sales::Questions::DepositDiscount < ::Form::Question @width = 5 @prefix = "£" @hint_text = "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme" + @question_number = 96 end end diff --git a/app/models/form/sales/questions/discount.rb b/app/models/form/sales/questions/discount.rb index 01ae38fd5..8c5cf7132 100644 --- a/app/models/form/sales/questions/discount.rb +++ b/app/models/form/sales/questions/discount.rb @@ -12,5 +12,6 @@ class Form::Sales::Questions::Discount < ::Form::Question @hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

If discount capped, enter capped %

If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given." + @question_number = 102 end end diff --git a/app/models/form/sales/questions/discounted_ownership_type.rb b/app/models/form/sales/questions/discounted_ownership_type.rb index f75d83c01..99e10b1db 100644 --- a/app/models/form/sales/questions/discounted_ownership_type.rb +++ b/app/models/form/sales/questions/discounted_ownership_type.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question @header = "What is the type of discounted ownership sale?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 5 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/equity.rb b/app/models/form/sales/questions/equity.rb index 7dec2ac37..0119fea69 100644 --- a/app/models/form/sales/questions/equity.rb +++ b/app/models/form/sales/questions/equity.rb @@ -10,5 +10,6 @@ class Form::Sales::Questions::Equity < ::Form::Question @width = 5 @suffix = "%" @hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)" + @question_number = 89 end end diff --git a/app/models/form/sales/questions/exchange_date.rb b/app/models/form/sales/questions/exchange_date.rb index 69b8ec39f..9e3ede3f4 100644 --- a/app/models/form/sales/questions/exchange_date.rb +++ b/app/models/form/sales/questions/exchange_date.rb @@ -5,5 +5,6 @@ class Form::Sales::Questions::ExchangeDate < ::Form::Question @check_answer_label = "Exchange of contracts date" @header = "What is the exchange of contracts date?" @type = "date" + @question_number = 81 end end diff --git a/app/models/form/sales/questions/extra_borrowing.rb b/app/models/form/sales/questions/extra_borrowing.rb index 04f906b22..f63413bba 100644 --- a/app/models/form/sales/questions/extra_borrowing.rb +++ b/app/models/form/sales/questions/extra_borrowing.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "extrabor" @check_answer_label = "Any other borrowing?" @header = "Does this include any extra borrowing?" @@ -8,6 +8,8 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question @answer_options = ANSWER_OPTIONS @page = page @hint_text = "" + @ownershipsch = ownershipsch + @question_number = question_number end ANSWER_OPTIONS = { @@ -15,4 +17,15 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question "2" => { "value" => "No" }, "3" => { "value" => "Don't know" }, }.freeze + + def question_number + case @ownershipsch + when 1 + 94 + when 2 + 107 + when 3 + 115 + end + end end diff --git a/app/models/form/sales/questions/fromprop.rb b/app/models/form/sales/questions/fromprop.rb index af33c67ea..88abc6b1b 100644 --- a/app/models/form/sales/questions/fromprop.rb +++ b/app/models/form/sales/questions/fromprop.rb @@ -8,6 +8,7 @@ class Form::Sales::Questions::Fromprop < ::Form::Question @hint_text = "" @page = page @answer_options = ANSWER_OPTIONS + @question_number = 86 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/gender_identity1.rb b/app/models/form/sales/questions/gender_identity1.rb index c31a9cc0b..b9b47ee0a 100644 --- a/app/models/form/sales/questions/gender_identity1.rb +++ b/app/models/form/sales/questions/gender_identity1.rb @@ -8,6 +8,7 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @answer_options = ANSWER_OPTIONS @check_answers_card_number = 1 + @question_number = 21 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/gender_identity2.rb b/app/models/form/sales/questions/gender_identity2.rb index e394ae325..15ef9fda1 100644 --- a/app/models/form/sales/questions/gender_identity2.rb +++ b/app/models/form/sales/questions/gender_identity2.rb @@ -13,6 +13,7 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 29 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/grant.rb b/app/models/form/sales/questions/grant.rb index beef93c58..9b0fd3091 100644 --- a/app/models/form/sales/questions/grant.rb +++ b/app/models/form/sales/questions/grant.rb @@ -9,6 +9,7 @@ class Form::Sales::Questions::Grant < ::Form::Question @max = 999_999 @width = 5 @prefix = "£" - @hint_text = "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB)" + @hint_text = "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy" + @question_number = 101 end end diff --git a/app/models/form/sales/questions/handover_date.rb b/app/models/form/sales/questions/handover_date.rb index 06a89eb04..389fe75d5 100644 --- a/app/models/form/sales/questions/handover_date.rb +++ b/app/models/form/sales/questions/handover_date.rb @@ -6,5 +6,6 @@ class Form::Sales::Questions::HandoverDate < ::Form::Question @header = "What is the practical completion or handover date?" @type = "date" @hint_text = "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)" + @question_number = 82 end end diff --git a/app/models/form/sales/questions/household_disability.rb b/app/models/form/sales/questions/household_disability.rb index c0edef69c..894024c27 100644 --- a/app/models/form/sales/questions/household_disability.rb +++ b/app/models/form/sales/questions/household_disability.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::HouseholdDisability < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "This includes any long-term health condition that has an impact on the person's day-to-day life" + @question_number = 65 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/household_wheelchair.rb b/app/models/form/sales/questions/household_wheelchair.rb index 9266909dc..cff617bad 100644 --- a/app/models/form/sales/questions/household_wheelchair.rb +++ b/app/models/form/sales/questions/household_wheelchair.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::HouseholdWheelchair < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "This can be inside or outside the home" + @question_number = 66 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/housing_benefits.rb b/app/models/form/sales/questions/housing_benefits.rb index a4af620e6..d1baa7d38 100644 --- a/app/models/form/sales/questions/housing_benefits.rb +++ b/app/models/form/sales/questions/housing_benefits.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::HousingBenefits < ::Form::Question @header = "#{joint_purchase ? 'Were the buyers' : 'Was the buyer'} receiving any of these housing-related benefits immediately before buying this property?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 71 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/joint_purchase.rb b/app/models/form/sales/questions/joint_purchase.rb index e2bf0f754..3de66ae1e 100644 --- a/app/models/form/sales/questions/joint_purchase.rb +++ b/app/models/form/sales/questions/joint_purchase.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question @header = "Is this a joint purchase?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 9 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/la_nominations.rb b/app/models/form/sales/questions/la_nominations.rb index 806f7cfdd..c43c99a02 100644 --- a/app/models/form/sales/questions/la_nominations.rb +++ b/app/models/form/sales/questions/la_nominations.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::LaNominations < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing" + @question_number = 83 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/leasehold_charges.rb b/app/models/form/sales/questions/leasehold_charges.rb index ef9260c56..697a91b26 100644 --- a/app/models/form/sales/questions/leasehold_charges.rb +++ b/app/models/form/sales/questions/leasehold_charges.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mscharge" @check_answer_label = "Monthly leasehold charges" @header = "Enter the total monthly charge" @@ -8,5 +8,18 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question @min = 0 @width = 5 @prefix = "£" + @ownershipsch = ownershipsch + @question_number = question_number + end + + def question_number + case @ownershipsch + when 1 + 98 + when 2 + 109 + when 3 + 117 + end end end diff --git a/app/models/form/sales/questions/leasehold_charges_known.rb b/app/models/form/sales/questions/leasehold_charges_known.rb index 2c28e1814..a800690e4 100644 --- a/app/models/form/sales/questions/leasehold_charges_known.rb +++ b/app/models/form/sales/questions/leasehold_charges_known.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::LeaseholdChargesKnown < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mscharge_known" @check_answer_label = "Monthly leasehold charges known?" @header = "Does the property have any monthly leasehold charges?" @@ -17,10 +17,23 @@ class Form::Sales::Questions::LeaseholdChargesKnown < ::Form::Question }, ], } + @ownershipsch = ownershipsch + @question_number = question_number end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" }, }.freeze + + def question_number + case @ownershipsch + when 1 + 98 + when 2 + 109 + when 3 + 117 + end + end end diff --git a/app/models/form/sales/questions/living_before_purchase.rb b/app/models/form/sales/questions/living_before_purchase.rb index f631220dc..4080e34b6 100644 --- a/app/models/form/sales/questions/living_before_purchase.rb +++ b/app/models/form/sales/questions/living_before_purchase.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, ownershipsch:) + super(id, hsh, page) @id = "proplen_asked" @check_answer_label = "Buyer lived in the property before purchasing" @header = "Did the buyer live in the property before purchasing it?" @@ -17,10 +17,21 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question }, ], } + @ownershipsch = ownershipsch + @question_number = question_number end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" }, }.freeze + + def question_number + case @ownershipsch + when 1 + 75 + when 2 + 99 + end + end end diff --git a/app/models/form/sales/questions/living_before_purchase_years.rb b/app/models/form/sales/questions/living_before_purchase_years.rb index f3f1e58a7..ec9cd9d52 100644 --- a/app/models/form/sales/questions/living_before_purchase_years.rb +++ b/app/models/form/sales/questions/living_before_purchase_years.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, ownershipsch:) + super(id, hsh, page) @id = "proplen" @check_answer_label = "Number of years living in the property before purchase" @header = header_text @@ -11,6 +11,8 @@ class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question @step = 1 @width = 5 @suffix = " years" + @ownershipsch = ownershipsch + @question_number = question_number end def header_text @@ -28,4 +30,13 @@ class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question "You should round this up to the nearest year. If the buyers haven't been living in the property, enter '0'" end end + + def question_number + case @ownershipsch + when 1 + 75 + when 2 + 99 + end + end end diff --git a/app/models/form/sales/questions/monthly_rent.rb b/app/models/form/sales/questions/monthly_rent.rb index 34ac1bed9..2a28bc691 100644 --- a/app/models/form/sales/questions/monthly_rent.rb +++ b/app/models/form/sales/questions/monthly_rent.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::MonthlyRent < ::Form::Question @width = 5 @prefix = "£" @hint_text = "Amount paid before any charges" + @question_number = 97 end end diff --git a/app/models/form/sales/questions/mortgage_amount.rb b/app/models/form/sales/questions/mortgage_amount.rb index bd4ae5e60..12959709a 100644 --- a/app/models/form/sales/questions/mortgage_amount.rb +++ b/app/models/form/sales/questions/mortgage_amount.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mortgage" @check_answer_label = "Mortgage amount" @header = "What is the mortgage amount?" @@ -9,5 +9,18 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question @width = 5 @prefix = "£" @hint_text = "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound." + @ownershipsch = ownershipsch + @question_number = question_number + end + + def question_number + case @ownershipsch + when 1 + 91 + when 2 + 104 + when 3 + 112 + end end end diff --git a/app/models/form/sales/questions/mortgage_lender.rb b/app/models/form/sales/questions/mortgage_lender.rb index 54c9a66c6..1fee10b8b 100644 --- a/app/models/form/sales/questions/mortgage_lender.rb +++ b/app/models/form/sales/questions/mortgage_lender.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mortgagelender" @check_answer_label = "Mortgage Lender" @header = "What is the name of the mortgage lender?" @@ -10,6 +10,8 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question @answer_options = ANSWER_OPTIONS @guidance_position = GuidancePosition::BOTTOM @guidance_partial = "mortgage_lender" + @ownershipsch = ownershipsch + @question_number = question_number end ANSWER_OPTIONS = { @@ -55,4 +57,15 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question "39" => "Yorkshire Building Society", "40" => "Other", }.freeze + + def question_number + case @ownershipsch + when 1 + 92 + when 2 + 105 + when 3 + 113 + end + end end diff --git a/app/models/form/sales/questions/mortgage_lender_other.rb b/app/models/form/sales/questions/mortgage_lender_other.rb index fa1fefa49..677b1c117 100644 --- a/app/models/form/sales/questions/mortgage_lender_other.rb +++ b/app/models/form/sales/questions/mortgage_lender_other.rb @@ -1,10 +1,23 @@ class Form::Sales::Questions::MortgageLenderOther < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mortgagelenderother" @check_answer_label = "Other Mortgage Lender" @header = "What is the other mortgage lender?" @type = "text" @page = page + @ownershipsch = ownershipsch + @question_number = question_number + end + + def question_number + case @ownershipsch + when 1 + 92 + when 2 + 105 + when 3 + 113 + end end end diff --git a/app/models/form/sales/questions/mortgage_length.rb b/app/models/form/sales/questions/mortgage_length.rb index 3f1603b75..adaa94d01 100644 --- a/app/models/form/sales/questions/mortgage_length.rb +++ b/app/models/form/sales/questions/mortgage_length.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mortlen" @check_answer_label = "Length of mortgage" @header = "What is the length of the mortgage?" @@ -10,5 +10,18 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question @width = 5 @suffix = " years" @hint_text = "You should round up to the nearest year. Value should not exceed 60 years." + @ownershipsch = ownershipsch + @question_number = question_number + end + + def question_number + case @ownershipsch + when 1 + 93 + when 2 + 106 + when 3 + 114 + end end end diff --git a/app/models/form/sales/questions/mortgageused.rb b/app/models/form/sales/questions/mortgageused.rb index ad18652c4..7f87b9230 100644 --- a/app/models/form/sales/questions/mortgageused.rb +++ b/app/models/form/sales/questions/mortgageused.rb @@ -1,11 +1,13 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, subsection, ownershipsch:) + super(id, hsh, subsection) @id = "mortgageused" @check_answer_label = "Mortgage used" @header = "Was a mortgage used for the purchase of this property?" @type = "radio" @answer_options = ANSWER_OPTIONS + @ownershipsch = ownershipsch + @question_number = question_number end ANSWER_OPTIONS = { @@ -20,4 +22,15 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question "2" => { "value" => "No" }, } end + + def question_number + case @ownershipsch + when 1 + 90 + when 2 + 103 + when 3 + 111 + end + end end diff --git a/app/models/form/sales/questions/nationality1.rb b/app/models/form/sales/questions/nationality1.rb index 765489f27..68c2ce5ea 100644 --- a/app/models/form/sales/questions/nationality1.rb +++ b/app/models/form/sales/questions/nationality1.rb @@ -14,6 +14,7 @@ class Form::Sales::Questions::Nationality1 < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 24 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/number_joint_buyers.rb b/app/models/form/sales/questions/number_joint_buyers.rb index b9c2fc2e2..bd8a6ef3a 100644 --- a/app/models/form/sales/questions/number_joint_buyers.rb +++ b/app/models/form/sales/questions/number_joint_buyers.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question @hint_text = "You should still try to answer all questions even if the buyer wasn't interviewed in person" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 10 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/number_of_others_in_property.rb b/app/models/form/sales/questions/number_of_others_in_property.rb index 97a873430..44e7e5563 100644 --- a/app/models/form/sales/questions/number_of_others_in_property.rb +++ b/app/models/form/sales/questions/number_of_others_in_property.rb @@ -9,6 +9,7 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question @width = 2 @min = 0 @max = joint_purchase ? 4 : 5 + @question_number = 35 end private diff --git a/app/models/form/sales/questions/other_ownership_type.rb b/app/models/form/sales/questions/other_ownership_type.rb index 428691381..08bd9955b 100644 --- a/app/models/form/sales/questions/other_ownership_type.rb +++ b/app/models/form/sales/questions/other_ownership_type.rb @@ -6,5 +6,6 @@ class Form::Sales::Questions::OtherOwnershipType < ::Form::Question @header = "What type of sale is it?" @type = "text" @width = 10 + @question_number = 6 end end diff --git a/app/models/form/sales/questions/outright_ownership_type.rb b/app/models/form/sales/questions/outright_ownership_type.rb index baead7f5a..01fa77a0d 100644 --- a/app/models/form/sales/questions/outright_ownership_type.rb +++ b/app/models/form/sales/questions/outright_ownership_type.rb @@ -9,6 +9,7 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question @conditional_for = { "othtype" => [12], } + @question_number = 6 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index fc30ce3b4..dc1d4fb29 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question @header = "Was this purchase made through an ownership scheme?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 3 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_age.rb b/app/models/form/sales/questions/person_age.rb index c0a3e55a8..779e09669 100644 --- a/app/models/form/sales/questions/person_age.rb +++ b/app/models/form/sales/questions/person_age.rb @@ -12,5 +12,6 @@ class Form::Sales::Questions::PersonAge < ::Form::Question @check_answers_card_number = person_index @min = 0 @max = 110 + @question_number = 29 + (4 * person_index) end end diff --git a/app/models/form/sales/questions/person_age_known.rb b/app/models/form/sales/questions/person_age_known.rb index 198b4ed30..9272bb21e 100644 --- a/app/models/form/sales/questions/person_age_known.rb +++ b/app/models/form/sales/questions/person_age_known.rb @@ -19,6 +19,7 @@ class Form::Sales::Questions::PersonAgeKnown < ::Form::Question ], } @check_answers_card_number = person_index + @question_number = 29 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_gender_identity.rb b/app/models/form/sales/questions/person_gender_identity.rb index 01967e737..94774f5ce 100644 --- a/app/models/form/sales/questions/person_gender_identity.rb +++ b/app/models/form/sales/questions/person_gender_identity.rb @@ -12,6 +12,7 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 30 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb index 774de4208..50f06c55e 100644 --- a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb +++ b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb @@ -12,6 +12,7 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 28 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/person_working_situation.rb b/app/models/form/sales/questions/person_working_situation.rb index 0740541b3..d74c38f14 100644 --- a/app/models/form/sales/questions/person_working_situation.rb +++ b/app/models/form/sales/questions/person_working_situation.rb @@ -12,6 +12,7 @@ class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question }, "value" => "Prefers not to say", }] + @question_number = 31 + (4 * person_index) end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/previous_bedrooms.rb b/app/models/form/sales/questions/previous_bedrooms.rb index 1bea6538c..d9f9aaddb 100644 --- a/app/models/form/sales/questions/previous_bedrooms.rb +++ b/app/models/form/sales/questions/previous_bedrooms.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::PreviousBedrooms < ::Form::Question @min = 1 @max = 6 @hint_text = "For bedsits enter 1" + @question_number = 85 end end diff --git a/app/models/form/sales/questions/previous_la_known.rb b/app/models/form/sales/questions/previous_la_known.rb index b38f5c560..1a9a646f3 100644 --- a/app/models/form/sales/questions/previous_la_known.rb +++ b/app/models/form/sales/questions/previous_la_known.rb @@ -20,6 +20,7 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question @conditional_for = { "prevloc" => [1], } + @question_number = 58 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/previous_postcode.rb b/app/models/form/sales/questions/previous_postcode.rb index 103a68ab6..568ba66ea 100644 --- a/app/models/form/sales/questions/previous_postcode.rb +++ b/app/models/form/sales/questions/previous_postcode.rb @@ -17,5 +17,6 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question "is_previous_la_inferred" => true, }, } + @question_number = 57 end end diff --git a/app/models/form/sales/questions/previous_postcode_known.rb b/app/models/form/sales/questions/previous_postcode_known.rb index 9806d12e4..e83fda8d3 100644 --- a/app/models/form/sales/questions/previous_postcode_known.rb +++ b/app/models/form/sales/questions/previous_postcode_known.rb @@ -20,6 +20,7 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question }, ], } + @question_number = 57 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/previous_tenure.rb b/app/models/form/sales/questions/previous_tenure.rb index e570ec90c..96b638cf8 100644 --- a/app/models/form/sales/questions/previous_tenure.rb +++ b/app/models/form/sales/questions/previous_tenure.rb @@ -8,6 +8,7 @@ class Form::Sales::Questions::PreviousTenure < ::Form::Question @hint_text = "" @page = page @answer_options = ANSWER_OPTIONS + @question_number = 87 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/previous_tenure_buyer2.rb b/app/models/form/sales/questions/previous_tenure_buyer2.rb index 49d495682..e3d8ee27d 100644 --- a/app/models/form/sales/questions/previous_tenure_buyer2.rb +++ b/app/models/form/sales/questions/previous_tenure_buyer2.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question @type = "radio" @hint_text = "" @answer_options = ANSWER_OPTIONS + @question_number = 61 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/prevloc.rb b/app/models/form/sales/questions/prevloc.rb index e7395e749..75bb50e81 100644 --- a/app/models/form/sales/questions/prevloc.rb +++ b/app/models/form/sales/questions/prevloc.rb @@ -11,6 +11,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question }, "value" => "Not known", }] + @question_number = 58 end def answer_options diff --git a/app/models/form/sales/questions/prevown.rb b/app/models/form/sales/questions/prevown.rb index 571e1af8f..1ae9fb90c 100644 --- a/app/models/form/sales/questions/prevown.rb +++ b/app/models/form/sales/questions/prevown.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::Prevown < ::Form::Question @header = I18n.t("questions.prevown", count: joint_purchase ? 2 : 1) @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 73 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/prevshared.rb b/app/models/form/sales/questions/prevshared.rb index 2c09cf485..b319281d3 100644 --- a/app/models/form/sales/questions/prevshared.rb +++ b/app/models/form/sales/questions/prevshared.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Prevshared < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint = "For any buyer" + @question_number = 74 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 4d7bb61c6..c08e4be6a 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question @type = "checkbox" @answer_options = ANSWER_OPTIONS @guidance_partial = "privacy_notice_buyer" + @question_number = 19 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/property_building_type.rb b/app/models/form/sales/questions/property_building_type.rb index 80102cc7a..fea48ce02 100644 --- a/app/models/form/sales/questions/property_building_type.rb +++ b/app/models/form/sales/questions/property_building_type.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question @header = "What type of building is the property?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 13 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/property_local_authority.rb b/app/models/form/sales/questions/property_local_authority.rb index 699a67984..d66f856ac 100644 --- a/app/models/form/sales/questions/property_local_authority.rb +++ b/app/models/form/sales/questions/property_local_authority.rb @@ -5,6 +5,7 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question @check_answer_label = "Local authority" @header = "What is the property’s local authority?" @type = "select" + @question_number = 16 end def answer_options diff --git a/app/models/form/sales/questions/property_local_authority_known.rb b/app/models/form/sales/questions/property_local_authority_known.rb index 912ddbd8e..196ee8e6a 100644 --- a/app/models/form/sales/questions/property_local_authority_known.rb +++ b/app/models/form/sales/questions/property_local_authority_known.rb @@ -14,6 +14,7 @@ class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question }, ], } + @question_number = 16 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/property_number_of_bedrooms.rb b/app/models/form/sales/questions/property_number_of_bedrooms.rb index e8ea674ea..9dbdbf3e8 100644 --- a/app/models/form/sales/questions/property_number_of_bedrooms.rb +++ b/app/models/form/sales/questions/property_number_of_bedrooms.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question @width = 10 @min = 1 @max = 9 + @question_number = 11 end end diff --git a/app/models/form/sales/questions/property_unit_type.rb b/app/models/form/sales/questions/property_unit_type.rb index afa4f0f38..f44bd67d3 100644 --- a/app/models/form/sales/questions/property_unit_type.rb +++ b/app/models/form/sales/questions/property_unit_type.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question @header = "What type of unit is the property?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 12 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/property_wheelchair_accessible.rb b/app/models/form/sales/questions/property_wheelchair_accessible.rb index bfdd133c2..feb017be0 100644 --- a/app/models/form/sales/questions/property_wheelchair_accessible.rb +++ b/app/models/form/sales/questions/property_wheelchair_accessible.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question @header = "Is the property build or adapted to wheelchair-user standards?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 17 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/purchase_price.rb b/app/models/form/sales/questions/purchase_price.rb index 6242e45e8..c98a39ef3 100644 --- a/app/models/form/sales/questions/purchase_price.rb +++ b/app/models/form/sales/questions/purchase_price.rb @@ -1,6 +1,6 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question - def initialize(id, hsh, page) - super + def initialize(id, hsh, page, ownershipsch:) + super(id, hsh, page) @id = "value" @check_answer_label = "Purchase price" @header = "What is the full purchase price?" @@ -9,5 +9,16 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question @width = 5 @prefix = "£" @hint_text = "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + @ownership_sch = ownershipsch + @question_number = question_number + end + + def question_number + case @ownership_sch + when 2 + 100 + when 3 + 110 + end end end diff --git a/app/models/form/sales/questions/purchase_price_outright_ownership.rb b/app/models/form/sales/questions/purchase_price_outright_ownership.rb deleted file mode 100644 index 9824a4629..000000000 --- a/app/models/form/sales/questions/purchase_price_outright_ownership.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Form::Sales::Questions::PurchasePriceOutrightOwnership < ::Form::Question - def initialize(id, hsh, page) - super - @id = "value" - @check_answer_label = "Purchase price" - @header = "What is the full purchase price?" - @type = "numeric" - @min = 0 - @width = 5 - @prefix = "£" - end -end diff --git a/app/models/form/sales/questions/purchaser_code.rb b/app/models/form/sales/questions/purchaser_code.rb index 7a5cc4bf7..d288c9f5b 100644 --- a/app/models/form/sales/questions/purchaser_code.rb +++ b/app/models/form/sales/questions/purchaser_code.rb @@ -7,5 +7,6 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question @hint_text = "This is how you usually refer to the purchaser on your own systems." @type = "text" @width = 10 + @question_number = 2 end end diff --git a/app/models/form/sales/questions/resale.rb b/app/models/form/sales/questions/resale.rb index e67491d65..e0d2d99f5 100644 --- a/app/models/form/sales/questions/resale.rb +++ b/app/models/form/sales/questions/resale.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Resale < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'." + @question_number = 80 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/sale_date.rb b/app/models/form/sales/questions/sale_date.rb index ce085b646..735872a6c 100644 --- a/app/models/form/sales/questions/sale_date.rb +++ b/app/models/form/sales/questions/sale_date.rb @@ -5,5 +5,6 @@ class Form::Sales::Questions::SaleDate < ::Form::Question @check_answer_label = "Sale completion date" @header = "What is the sale completion date?" @type = "date" + @question_number = 1 end end diff --git a/app/models/form/sales/questions/savings.rb b/app/models/form/sales/questions/savings.rb index 920b87d4f..086a0ec8d 100644 --- a/app/models/form/sales/questions/savings.rb +++ b/app/models/form/sales/questions/savings.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::Savings < ::Form::Question @prefix = "£" @step = 1 @min = 0 + @question_number = 72 end end diff --git a/app/models/form/sales/questions/savings_nk.rb b/app/models/form/sales/questions/savings_nk.rb index f68b45560..515f0a544 100644 --- a/app/models/form/sales/questions/savings_nk.rb +++ b/app/models/form/sales/questions/savings_nk.rb @@ -16,6 +16,7 @@ class Form::Sales::Questions::SavingsNk < ::Form::Question }, ], } + @question_number = 72 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb index 73b6a4e17..e0cb5b486 100644 --- a/app/models/form/sales/questions/shared_ownership_type.rb +++ b/app/models/form/sales/questions/shared_ownership_type.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question @hint_text = "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" @type = "radio" @answer_options = answer_options + @question_number = 4 end def answer_options diff --git a/app/models/form/sales/questions/staircase.rb b/app/models/form/sales/questions/staircase.rb index c03c24089..d01f0ea40 100644 --- a/app/models/form/sales/questions/staircase.rb +++ b/app/models/form/sales/questions/staircase.rb @@ -7,6 +7,7 @@ class Form::Sales::Questions::Staircase < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @hint_text = "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property" + @question_number = 76 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/staircase_bought.rb b/app/models/form/sales/questions/staircase_bought.rb index 385cfb782..9e54e92d3 100644 --- a/app/models/form/sales/questions/staircase_bought.rb +++ b/app/models/form/sales/questions/staircase_bought.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::StaircaseBought < ::Form::Question @min = 0 @max = 100 @suffix = "%" + @question_number = 77 end end diff --git a/app/models/form/sales/questions/staircase_owned.rb b/app/models/form/sales/questions/staircase_owned.rb index a3596554e..b8d5a65ec 100644 --- a/app/models/form/sales/questions/staircase_owned.rb +++ b/app/models/form/sales/questions/staircase_owned.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::StaircaseOwned < ::Form::Question @min = 0 @max = 100 @suffix = "%" + @question_number = 78 end end diff --git a/app/models/form/sales/questions/staircase_sale.rb b/app/models/form/sales/questions/staircase_sale.rb index fb56572cf..aaf2f6a08 100644 --- a/app/models/form/sales/questions/staircase_sale.rb +++ b/app/models/form/sales/questions/staircase_sale.rb @@ -6,6 +6,7 @@ class Form::Sales::Questions::StaircaseSale < ::Form::Question @header = "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?" @type = "radio" @answer_options = ANSWER_OPTIONS + @question_number = 79 end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/value.rb b/app/models/form/sales/questions/value.rb index 24e20e5ca..4736f37af 100644 --- a/app/models/form/sales/questions/value.rb +++ b/app/models/form/sales/questions/value.rb @@ -9,5 +9,6 @@ class Form::Sales::Questions::Value < ::Form::Question @width = 5 @prefix = "£" @hint_text = "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)" + @question_number = 88 end end diff --git a/app/models/form/sales/subsections/discounted_ownership_scheme.rb b/app/models/form/sales/subsections/discounted_ownership_scheme.rb index a44f10ee9..f9292b6d6 100644 --- a/app/models/form/sales/subsections/discounted_ownership_scheme.rb +++ b/app/models/form/sales/subsections/discounted_ownership_scheme.rb @@ -8,30 +8,30 @@ class Form::Sales::Subsections::DiscountedOwnershipScheme < ::Form::Subsection def pages @pages ||= [ - Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_discounted_ownership", nil, self), + Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::AboutPriceRtb.new(nil, nil, self), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_price_value_check", nil, self), Form::Sales::Pages::AboutPriceNotRtb.new(nil, nil, self), Form::Sales::Pages::GrantValueCheck.new(nil, nil, self), - Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_ownership", nil, self), + Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_discounted_ownership_value_check", nil, self), Form::Sales::Pages::DepositAndMortgageValueCheck.new("discounted_ownership_deposit_and_mortgage_value_check_after_value_and_discount", nil, self), - Form::Sales::Pages::Mortgageused.new("mortgage_used_discounted_ownership", nil, self), + Form::Sales::Pages::Mortgageused.new("mortgage_used_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::MortgageValueCheck.new("discounted_ownership_mortgage_used_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageAmount.new("mortgage_amount_discounted_ownership", nil, self), + Form::Sales::Pages::MortgageAmount.new("mortgage_amount_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::MortgageValueCheck.new("discounted_ownership_mortgage_amount_mortgage_value_check", nil, self), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_mortgage_value_check", nil, self), Form::Sales::Pages::DepositAndMortgageValueCheck.new("discounted_ownership_deposit_and_mortgage_value_check_after_mortgage", nil, self), - Form::Sales::Pages::MortgageLender.new("mortgage_lender_discounted_ownership", nil, self), - Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_discounted_ownership", nil, self), - Form::Sales::Pages::MortgageLength.new("mortgage_length_discounted_ownership", nil, self), - Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_discounted_ownership", nil, self), + Form::Sales::Pages::MortgageLender.new("mortgage_lender_discounted_ownership", nil, self, ownershipsch: 2), + Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_discounted_ownership", nil, self, ownershipsch: 2), + Form::Sales::Pages::MortgageLength.new("mortgage_length_discounted_ownership", nil, self, ownershipsch: 2), + Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_value_check", nil, self), - Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_discounted_ownership", nil, self), + Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::ExtraBorrowingValueCheck.new("extra_borrowing_deposit_value_check", nil, self), Form::Sales::Pages::DepositValueCheck.new("discounted_ownership_deposit_value_check", nil, self), Form::Sales::Pages::DepositAndMortgageValueCheck.new("discounted_ownership_deposit_and_mortgage_value_check_after_deposit", nil, self), - Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_discounted_ownership", nil, self), + Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_discounted_ownership", nil, self, ownershipsch: 2), Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_discounted_ownership_value_check", nil, self), ] end diff --git a/app/models/form/sales/subsections/outright_sale.rb b/app/models/form/sales/subsections/outright_sale.rb index 100c8fa64..d29dc5759 100644 --- a/app/models/form/sales/subsections/outright_sale.rb +++ b/app/models/form/sales/subsections/outright_sale.rb @@ -8,17 +8,17 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection def pages @pages ||= [ - Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_sale", nil, self), + Form::Sales::Pages::PurchasePriceOutrightOwnership.new("purchase_price_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_outright_sale_value_check", nil, self), - Form::Sales::Pages::Mortgageused.new("mortgage_used_outright_sale", nil, self), + Form::Sales::Pages::Mortgageused.new("mortgage_used_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self), + Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_amount_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self), - Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self), - Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self), - Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self), - Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_outright_sale", nil, self), + Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3), + Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3), + Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self, ownershipsch: 3), + Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self, ownershipsch: 3), + Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::DepositValueCheck.new("outright_sale_deposit_value_check", nil, self), leasehold_charge_pages, Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_outright_sale_value_check", nil, self), @@ -31,7 +31,7 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection def leasehold_charge_pages if form.start_date.year >= 2023 - Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_outright_sale", nil, self) + Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_outright_sale", nil, self, ownershipsch: 3) end end end diff --git a/app/models/form/sales/subsections/shared_ownership_scheme.rb b/app/models/form/sales/subsections/shared_ownership_scheme.rb index 1c30f3b6f..afd13ec47 100644 --- a/app/models/form/sales/subsections/shared_ownership_scheme.rb +++ b/app/models/form/sales/subsections/shared_ownership_scheme.rb @@ -8,7 +8,7 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection def pages @pages ||= [ - Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_shared_ownership", nil, self), + Form::Sales::Pages::LivingBeforePurchase.new("living_before_purchase_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::Staircase.new(nil, nil, self), Form::Sales::Pages::AboutStaircase.new("about_staircasing_joint_purchase", nil, self, joint_purchase: true), Form::Sales::Pages::AboutStaircase.new("about_staircasing_not_joint_purchase", nil, self, joint_purchase: false), @@ -26,21 +26,21 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::AboutPriceSharedOwnership.new(nil, nil, self), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_shared_ownership_value_check", nil, self), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_equity_value_check", nil, self), - Form::Sales::Pages::Mortgageused.new("mortgage_used_shared_ownership", nil, self), + Form::Sales::Pages::Mortgageused.new("mortgage_used_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::MortgageValueCheck.new("mortgage_used_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageAmount.new("mortgage_amount_shared_ownership", nil, self), + Form::Sales::Pages::MortgageAmount.new("mortgage_amount_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_mortgage_amount_value_check", nil, self), Form::Sales::Pages::MortgageValueCheck.new("mortgage_amount_mortgage_value_check", nil, self), - Form::Sales::Pages::MortgageLender.new("mortgage_lender_shared_ownership", nil, self), - Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_shared_ownership", nil, self), - Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self), - Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self), + Form::Sales::Pages::MortgageLender.new("mortgage_lender_shared_ownership", nil, self, ownershipsch: 1), + Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_shared_ownership", nil, self, ownershipsch: 1), + Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, ownershipsch: 1), + Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::AboutDepositWithDiscount.new(nil, nil, self), - Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_shared_ownership", nil, self), + Form::Sales::Pages::AboutDepositWithoutDiscount.new("about_deposit_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_deposit_value_check", nil, self), Form::Sales::Pages::MonthlyRent.new(nil, nil, self), - Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self), + Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_shared_ownership_value_check", nil, self), ] end diff --git a/app/views/form/_check_answers_summary_list.html.erb b/app/views/form/_check_answers_summary_list.html.erb index 56ae87905..bb9b1e56b 100644 --- a/app/views/form/_check_answers_summary_list.html.erb +++ b/app/views/form/_check_answers_summary_list.html.erb @@ -1,7 +1,7 @@ <%= govuk_summary_list do |summary_list| %> <% total_applicable_questions(subsection, @log, current_user).each do |question| %> <% summary_list.row do |row| %> - <% row.key { question.check_answer_label.to_s.presence || question.header.to_s } %> + <% row.key { get_question_label(question) } %> <% row.value do %> <%= get_answer_label(question, @log) %> <% extra_value = question.get_extra_check_answer_value(@log) %> diff --git a/spec/components/check_answers_summary_list_card_component_spec.rb b/spec/components/check_answers_summary_list_card_component_spec.rb index f9b8f6667..41bf32e28 100644 --- a/spec/components/check_answers_summary_list_card_component_spec.rb +++ b/spec/components/check_answers_summary_list_card_component_spec.rb @@ -5,44 +5,63 @@ RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do let(:rendered) { render_inline(component) } - context "when given a set of questions" do - let(:user) { build(:user) } - let(:log) { build(:lettings_log, :completed, age2: 99, startdate: Time.zone.local(2021, 5, 1)) } - let(:subsection_id) { "household_characteristics" } - let(:subsection) { log.form.get_subsection(subsection_id) } - let(:questions) { subsection.applicable_questions(log) } - - it "renders a summary list card for the answers to those questions" do - expect(rendered).to have_content(questions.first.answer_label(log)) - end + context "when before 23/24 collection" do + context "when given a set of questions" do + let(:user) { build(:user) } + let(:log) { build(:lettings_log, :completed, age2: 99, startdate: Time.zone.local(2021, 5, 1)) } + let(:subsection_id) { "household_characteristics" } + let(:subsection) { log.form.get_subsection(subsection_id) } + let(:questions) { subsection.applicable_questions(log) } - it "applicable questions doesn't return questions that are hidden in check answers" do - expect(component.applicable_questions.map(&:id).include?("retirement_value_check")).to eq(false) - end + it "renders a summary list card without question numbers for the answers to those questions" do + expect(rendered).to have_content(questions.first.answer_label(log)) + expect(rendered).to have_content("Lead tenant’s age") + expect(rendered).not_to have_content("Q32 - Lead tenant’s age") + end - it "has the correct answer label for a question" do - sex1_question = questions[2] - expect(component.get_answer_label(sex1_question)).to eq("Female") - end + it "applicable questions doesn't return questions that are hidden in check answers" do + expect(component.applicable_questions.map(&:id).include?("retirement_value_check")).to eq(false) + end + + it "has the correct answer label for a question" do + sex1_question = questions[2] + expect(component.get_answer_label(sex1_question)).to eq("Female") + end - context "when log was created via a bulk upload and has an unanswered question" do - subject(:component) { described_class.new(questions:, log:, user:) } + context "when log was created via a bulk upload and has an unanswered question" do + subject(:component) { described_class.new(questions:, log:, user:) } - let(:bulk_upload) { build(:bulk_upload, :lettings) } - let(:log) { build(:lettings_log, :in_progress, bulk_upload:, age2: 99, startdate: Time.zone.local(2021, 5, 1)) } + let(:bulk_upload) { build(:bulk_upload, :lettings) } + let(:log) { build(:lettings_log, :in_progress, bulk_upload:, age2: 99, startdate: Time.zone.local(2021, 5, 1)) } - it "displays tweaked copy in red" do - expect(rendered).to have_selector("span", class: "app-!-colour-red", text: "You still need to answer this question") + it "displays tweaked copy in red" do + expect(rendered).to have_selector("span", class: "app-!-colour-red", text: "You still need to answer this question") + end end - end - context "when log was not created via a bulk upload and has an unanswered question" do - subject(:component) { described_class.new(questions:, log:, user:) } + context "when log was not created via a bulk upload and has an unanswered question" do + subject(:component) { described_class.new(questions:, log:, user:) } + + let(:log) { build(:lettings_log, :in_progress, age2: 99, startdate: Time.zone.local(2021, 5, 1)) } + + it "displays normal copy with muted colour " do + expect(rendered).to have_selector("span", class: "app-!-colour-muted", text: "You didn’t answer this question") + end + end + end + end - let(:log) { build(:lettings_log, :in_progress, age2: 99, startdate: Time.zone.local(2021, 5, 1)) } + context "when in 23/24 collection" do + context "when given a set of questions" do + let(:user) { build(:user) } + let(:log) { build(:lettings_log, :completed, age2: 99, startdate: Time.zone.local(2023, 5, 1)) } + let(:subsection_id) { "household_characteristics" } + let(:subsection) { log.form.get_subsection(subsection_id) } + let(:questions) { subsection.applicable_questions(log) } - it "displays normal copy with muted colour " do - expect(rendered).to have_selector("span", class: "app-!-colour-muted", text: "You didn’t answer this question") + it "renders a summary list card includinq question numbers for the answers to those questions" do + expect(rendered).to have_content(questions.first.answer_label(log)) + expect(rendered).to have_content("Q32 - Lead tenant’s age") end end end diff --git a/spec/helpers/question_view_helper_spec.rb b/spec/helpers/question_view_helper_spec.rb index 82f6d0b08..e170efe15 100644 --- a/spec/helpers/question_view_helper_spec.rb +++ b/spec/helpers/question_view_helper_spec.rb @@ -44,7 +44,13 @@ RSpec.describe QuestionViewHelper do describe "legend" do subject(:question_view_helper) { legend(question, page_header, conditional) } - let(:question) { OpenStruct.new(header: "Some question header") } + question_stub = Struct.new(:header) do + def question_number_string(_conditional) + nil + end + end + + let(:question) { question_stub.new("Some question header") } let(:size) { "m" } let(:tag) { "div" } let(:legend_options_hash) do @@ -67,7 +73,7 @@ RSpec.describe QuestionViewHelper do end end - context "when viewinng a conditional question" do + context "when viewing a conditional question" do let(:conditional) { true } let(:tag) { "" } diff --git a/spec/models/form/sales/pages/about_deposit_without_discount_spec.rb b/spec/models/form/sales/pages/about_deposit_without_discount_spec.rb index 62212e011..1a0b5ef4d 100644 --- a/spec/models/form/sales/pages/about_deposit_without_discount_spec.rb +++ b/spec/models/form/sales/pages/about_deposit_without_discount_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::AboutDepositWithoutDiscount, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { nil } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/extra_borrowing_spec.rb b/spec/models/form/sales/pages/extra_borrowing_spec.rb index 5540f89cf..a0c148c9f 100644 --- a/spec/models/form/sales/pages/extra_borrowing_spec.rb +++ b/spec/models/form/sales/pages/extra_borrowing_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::ExtraBorrowing, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { nil } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/leasehold_charges_spec.rb b/spec/models/form/sales/pages/leasehold_charges_spec.rb index c729bc82e..d58b965c3 100644 --- a/spec/models/form/sales/pages/leasehold_charges_spec.rb +++ b/spec/models/form/sales/pages/leasehold_charges_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::LeaseholdCharges, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { nil } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/living_before_purchase_spec.rb b/spec/models/form/sales/pages/living_before_purchase_spec.rb index 76dbd7609..939910583 100644 --- a/spec/models/form/sales/pages/living_before_purchase_spec.rb +++ b/spec/models/form/sales/pages/living_before_purchase_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::LivingBeforePurchase, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { nil } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/mortgage_amount_spec.rb b/spec/models/form/sales/pages/mortgage_amount_spec.rb index 1aa563d9b..551788fbb 100644 --- a/spec/models/form/sales/pages/mortgage_amount_spec.rb +++ b/spec/models/form/sales/pages/mortgage_amount_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageAmount, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { nil } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/mortgage_lender_other_spec.rb b/spec/models/form/sales/pages/mortgage_lender_other_spec.rb index 32ad5bb6b..93ef4d342 100644 --- a/spec/models/form/sales/pages/mortgage_lender_other_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_other_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageLenderOther, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { "mortgage_lender_other" } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/mortgage_lender_spec.rb b/spec/models/form/sales/pages/mortgage_lender_spec.rb index fafa8e043..ad195b8a1 100644 --- a/spec/models/form/sales/pages/mortgage_lender_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageLender, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { "mortgage_lender" } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/mortgage_length_spec.rb b/spec/models/form/sales/pages/mortgage_length_spec.rb index ef2573e57..5b04503a0 100644 --- a/spec/models/form/sales/pages/mortgage_length_spec.rb +++ b/spec/models/form/sales/pages/mortgage_length_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::MortgageLength, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { nil } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/mortgageused_spec.rb b/spec/models/form/sales/pages/mortgageused_spec.rb index 963814074..71fe94128 100644 --- a/spec/models/form/sales/pages/mortgageused_spec.rb +++ b/spec/models/form/sales/pages/mortgageused_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::Mortgageused, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { "mortgage_used" } let(:page_definition) { nil } diff --git a/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb b/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb index 88c357034..11b84baa6 100644 --- a/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::PurchasePriceOutrightOwnership, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } + subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } let(:page_id) { "purchase_price" } let(:page_definition) { nil } diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb index fd62707bd..31df4708c 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 1’s Arab background?") + expect(question.header).to eq("Which of the following best describes buyer 1’s Arab background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb index 1b7c99988..931802fe5 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 1’s Asian or Asian British background?") + expect(question.header).to eq("Which of the following best describes buyer 1’s Asian or Asian British background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb index c324556f7..c4b7919c8 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 1’s Black, African, Caribbean or Black British background?") + expect(question.header).to eq("Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb index efbb928d4..f6fbdf3b0 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 1’s Mixed or Multiple ethnic groups background?") + expect(question.header).to eq("Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb index e155378a3..684477542 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 1’s White background?") + expect(question.header).to eq("Which of the following best describes buyer 1’s White background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer1_income_known_spec.rb b/spec/models/form/sales/questions/buyer1_income_known_spec.rb index aafe16c2d..2abd58d3a 100644 --- a/spec/models/form/sales/questions/buyer1_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_known_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeKnown, type: :model do end it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gross annual income") + expect(question.check_answer_label).to eq("Buyer 1’s gross annual income known?") end it "has the correct type" do diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb index 9fd408db9..0ec22b6bf 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundArab, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 2’s Arab background?") + expect(question.header).to eq("Which of the following best describes buyer 2’s Arab background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb index 67ce60e43..86a59b65f 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundAsian, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 2’s Asian or Asian British background?") + expect(question.header).to eq("Which of the following best describes buyer 2’s Asian or Asian British background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb index 8e772f870..db5cbba0d 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundBlack, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 2’s Black, African, Caribbean or Black British background?") + expect(question.header).to eq("Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb index 6c1b12865..255251e90 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundMixed, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 2’s Mixed or Multiple ethnic groups background?") + expect(question.header).to eq("Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb index d3f2da508..d8aaa0292 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model end it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the buyer 2’s White background?") + expect(question.header).to eq("Which of the following best describes buyer 2’s White background?") end it "has the correct check_answer_label" do diff --git a/spec/models/form/sales/questions/buyer2_income_known_spec.rb b/spec/models/form/sales/questions/buyer2_income_known_spec.rb index a1be51ad4..6724b9b0d 100644 --- a/spec/models/form/sales/questions/buyer2_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_known_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeKnown, type: :model do end it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gross annual income") + expect(question.check_answer_label).to eq("Buyer 2’s gross annual income known?") end it "has the correct type" do diff --git a/spec/models/form/sales/questions/deposit_amount_spec.rb b/spec/models/form/sales/questions/deposit_amount_spec.rb index 33a5dcf1d..e0a77b7fc 100644 --- a/spec/models/form/sales/questions/deposit_amount_spec.rb +++ b/spec/models/form/sales/questions/deposit_amount_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::DepositAmount, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/extra_borrowing_spec.rb b/spec/models/form/sales/questions/extra_borrowing_spec.rb index b9149c27d..cc0656031 100644 --- a/spec/models/form/sales/questions/extra_borrowing_spec.rb +++ b/spec/models/form/sales/questions/extra_borrowing_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/grant_spec.rb b/spec/models/form/sales/questions/grant_spec.rb index d4e92f703..cd74ee704 100644 --- a/spec/models/form/sales/questions/grant_spec.rb +++ b/spec/models/form/sales/questions/grant_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Form::Sales::Questions::Grant, type: :model do end it "has the correct hint" do - expect(question.hint_text).to eq("For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB)") + expect(question.hint_text).to eq("For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy") end it "has correct width" do diff --git a/spec/models/form/sales/questions/leasehold_charges_known_spec.rb b/spec/models/form/sales/questions/leasehold_charges_known_spec.rb index d47b535eb..64cd08f33 100644 --- a/spec/models/form/sales/questions/leasehold_charges_known_spec.rb +++ b/spec/models/form/sales/questions/leasehold_charges_known_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::LeaseholdChargesKnown, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/leasehold_charges_spec.rb b/spec/models/form/sales/questions/leasehold_charges_spec.rb index a06fc9975..a9be62ef5 100644 --- a/spec/models/form/sales/questions/leasehold_charges_spec.rb +++ b/spec/models/form/sales/questions/leasehold_charges_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::LeaseholdCharges, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/living_before_purchase_spec.rb b/spec/models/form/sales/questions/living_before_purchase_spec.rb index 530bb151a..624865aac 100644 --- a/spec/models/form/sales/questions/living_before_purchase_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb index 5fdb5ccba..52ea05a4f 100644 --- a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/mortgage_amount_spec.rb b/spec/models/form/sales/questions/mortgage_amount_spec.rb index 832b47d37..328406ecd 100644 --- a/spec/models/form/sales/questions/mortgage_amount_spec.rb +++ b/spec/models/form/sales/questions/mortgage_amount_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/mortgage_lender_other_spec.rb b/spec/models/form/sales/questions/mortgage_lender_other_spec.rb index e5a8a3869..8150c1088 100644 --- a/spec/models/form/sales/questions/mortgage_lender_other_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_other_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageLenderOther, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/mortgage_lender_spec.rb b/spec/models/form/sales/questions/mortgage_lender_spec.rb index 659cf7070..84caef701 100644 --- a/spec/models/form/sales/questions/mortgage_lender_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/mortgage_length_spec.rb b/spec/models/form/sales/questions/mortgage_length_spec.rb index 0f3193244..bb77c16e6 100644 --- a/spec/models/form/sales/questions/mortgage_length_spec.rb +++ b/spec/models/form/sales/questions/mortgage_length_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/mortgageused_spec.rb b/spec/models/form/sales/questions/mortgageused_spec.rb index a31f063c9..32fdfde72 100644 --- a/spec/models/form/sales/questions/mortgageused_spec.rb +++ b/spec/models/form/sales/questions/mortgageused_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/questions/purchase_price_spec.rb b/spec/models/form/sales/questions/purchase_price_spec.rb index ce0aaae9c..e9e7ee3c3 100644 --- a/spec/models/form/sales/questions/purchase_price_spec.rb +++ b/spec/models/form/sales/questions/purchase_price_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } + subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) } let(:question_id) { nil } let(:question_definition) { nil } diff --git a/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb b/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb index 5d1d30037..b6947661d 100644 --- a/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb +++ b/spec/models/form/sales/subsections/discounted_ownership_scheme_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Form::Sales::Subsections::DiscountedOwnershipScheme, type: :model extra_borrowing_price_value_check about_price_not_rtb grant_value_check - purchase_price_outright_ownership + purchase_price_discounted_ownership about_price_discounted_ownership_value_check discounted_ownership_deposit_and_mortgage_value_check_after_value_and_discount mortgage_used_discounted_ownership