diff --git a/app/models/form/sales/pages/last_accommodation.rb b/app/models/form/sales/pages/last_accommodation.rb index 457da99b1..f9d167028 100644 --- a/app/models/form/sales/pages/last_accommodation.rb +++ b/app/models/form/sales/pages/last_accommodation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page def initialize(id, hsh, subsection) super @id = "last_accommodation" + @copy_key = "sales.household_situation.last_accommodation" end def questions diff --git a/app/models/form/sales/pages/last_accommodation_la.rb b/app/models/form/sales/pages/last_accommodation_la.rb index 1c126a28d..9cae326bf 100644 --- a/app/models/form/sales/pages/last_accommodation_la.rb +++ b/app/models/form/sales/pages/last_accommodation_la.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page def initialize(id, hsh, subsection) super @id = "last_accommodation_la" + @copy_key = "sales.household_situation.last_accommodation_la" @depends_on = [{ "is_previous_la_inferred" => false, }] diff --git a/app/models/form/sales/questions/buyer1_previous_tenure.rb b/app/models/form/sales/questions/buyer1_previous_tenure.rb index 4f560f10d..aea90af30 100644 --- a/app/models/form/sales/questions/buyer1_previous_tenure.rb +++ b/app/models/form/sales/questions/buyer1_previous_tenure.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question def initialize(id, hsh, page) super @id = "prevten" - @check_answer_label = "Buyer 1’s previous tenure" - @header = "What was buyer 1’s previous tenure?" @type = "radio" @answer_options = answer_options @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/buyer2_living_in.rb b/app/models/form/sales/questions/buyer2_living_in.rb index 83b1712fe..0939d119f 100644 --- a/app/models/form/sales/questions/buyer2_living_in.rb +++ b/app/models/form/sales/questions/buyer2_living_in.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question def initialize(id, hsh, page) super @id = "buy2living" - @check_answer_label = "Buyer 2 living at the same address" - @header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?" @type = "radio" - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/buyers_organisations.rb b/app/models/form/sales/questions/buyers_organisations.rb index 714f7a2e3..727a65ad0 100644 --- a/app/models/form/sales/questions/buyers_organisations.rb +++ b/app/models/form/sales/questions/buyers_organisations.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question def initialize(id, hsh, page) super @id = "buyers_organisations" - @check_answer_label = "Organisations buyers were registered with" - @header = "What organisations were the buyers registered with?" @type = "checkbox" - @hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end @@ -27,9 +24,5 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question } end - def unanswered_error_message - "At least one option must be selected of these four" - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze end diff --git a/app/models/form/sales/questions/previous_la_known.rb b/app/models/form/sales/questions/previous_la_known.rb index 7a31fbd74..a54a98d11 100644 --- a/app/models/form/sales/questions/previous_la_known.rb +++ b/app/models/form/sales/questions/previous_la_known.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question def initialize(id, hsh, page) super @id = "previous_la_known" - @check_answer_label = "Local authority of buyer 1’s last settled accommodation" - @header = "Do you know the local authority of buyer 1’s last settled accommodation?" + @copy_key = "sales.household_situation.last_accommodation_la.previous_la_known" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "This is also known as the household’s 'last settled home'" @hidden_in_check_answers = { "depends_on" => [ { diff --git a/app/models/form/sales/questions/previous_postcode.rb b/app/models/form/sales/questions/previous_postcode.rb index a0a4fe725..32b4e153e 100644 --- a/app/models/form/sales/questions/previous_postcode.rb +++ b/app/models/form/sales/questions/previous_postcode.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question def initialize(id, hsh, page) super @id = "ppostcode_full" - @check_answer_label = "Postcode of buyer 1’s last settled accommodation" - @header = "Postcode" + @copy_key = "sales.household_situation.last_accommodation.ppostcode_full" @type = "text" @width = 5 @inferred_check_answers_value = [{ diff --git a/app/models/form/sales/questions/previous_postcode_known.rb b/app/models/form/sales/questions/previous_postcode_known.rb index d9df53f6c..c2156b887 100644 --- a/app/models/form/sales/questions/previous_postcode_known.rb +++ b/app/models/form/sales/questions/previous_postcode_known.rb @@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "ppcodenk" - @check_answer_label = "Buyer 1’s last settled accommodation" - @header = "Do you know the postcode of buyer 1’s last settled accommodation?" + @copy_key = "sales.household_situation.last_accommodation.ppcodenk" @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { "ppostcode_full" => [0], } - @hint_text = "This is also known as the household’s 'last settled home'" @hidden_in_check_answers = { "depends_on" => [ { diff --git a/app/models/form/sales/questions/previous_tenure_buyer2.rb b/app/models/form/sales/questions/previous_tenure_buyer2.rb index 2873b8dc5..db606e254 100644 --- a/app/models/form/sales/questions/previous_tenure_buyer2.rb +++ b/app/models/form/sales/questions/previous_tenure_buyer2.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question def initialize(id, hsh, page) super @id = "prevtenbuy2" - @check_answer_label = "Buyer 2’s previous tenure" - @header = "What was buyer 2’s previous tenure?" @type = "radio" - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/prevloc.rb b/app/models/form/sales/questions/prevloc.rb index b8c46f427..5deb48877 100644 --- a/app/models/form/sales/questions/prevloc.rb +++ b/app/models/form/sales/questions/prevloc.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question def initialize(id, hsh, page) super @id = "prevloc" - @check_answer_label = "Local authority of buyer 1’s last settled accommodation" - @header = "Select a local authority" + @copy_key = "sales.household_situation.last_accommodation_la.prevloc" @type = "select" @inferred_check_answers_value = [{ "condition" => { diff --git a/config/locales/forms/2023/sales/household_situation.en.yml b/config/locales/forms/2023/sales/household_situation.en.yml new file mode 100644 index 000000000..e22777a28 --- /dev/null +++ b/config/locales/forms/2023/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2023: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + header: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" diff --git a/config/locales/forms/2024/sales/household_situation.en.yml b/config/locales/forms/2024/sales/household_situation.en.yml new file mode 100644 index 000000000..1ab6d540e --- /dev/null +++ b/config/locales/forms/2024/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2024: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?"