Browse Source

Extract question and page copy to translation files

pull/2702/head
Kat 2 years ago committed by Kat
parent
commit
ee535b5079
  1. 1
      app/models/form/sales/pages/age2.rb
  2. 1
      app/models/form/sales/pages/buyer1_ethnic_background_arab.rb
  3. 1
      app/models/form/sales/pages/buyer1_ethnic_background_asian.rb
  4. 1
      app/models/form/sales/pages/buyer1_ethnic_background_black.rb
  5. 1
      app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb
  6. 1
      app/models/form/sales/pages/buyer1_ethnic_background_white.rb
  7. 1
      app/models/form/sales/pages/buyer2_ethnic_background_arab.rb
  8. 1
      app/models/form/sales/pages/buyer2_ethnic_background_asian.rb
  9. 1
      app/models/form/sales/pages/buyer2_ethnic_background_black.rb
  10. 1
      app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb
  11. 1
      app/models/form/sales/pages/buyer2_ethnic_background_white.rb
  12. 1
      app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb
  13. 6
      app/models/form/sales/pages/buyer_interview.rb
  14. 1
      app/models/form/sales/pages/person_age.rb
  15. 1
      app/models/form/sales/pages/person_gender_identity.rb
  16. 1
      app/models/form/sales/pages/person_relationship_to_buyer_1.rb
  17. 1
      app/models/form/sales/pages/person_working_situation.rb
  18. 6
      app/models/form/sales/pages/privacy_notice.rb
  19. 2
      app/models/form/sales/questions/age1.rb
  20. 3
      app/models/form/sales/questions/age2.rb
  21. 3
      app/models/form/sales/questions/buyer1_age_known.rb
  22. 4
      app/models/form/sales/questions/buyer1_ethnic_background_arab.rb
  23. 4
      app/models/form/sales/questions/buyer1_ethnic_background_asian.rb
  24. 4
      app/models/form/sales/questions/buyer1_ethnic_background_black.rb
  25. 4
      app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb
  26. 4
      app/models/form/sales/questions/buyer1_ethnic_background_white.rb
  27. 3
      app/models/form/sales/questions/buyer1_ethnic_group.rb
  28. 3
      app/models/form/sales/questions/buyer1_live_in_property.rb
  29. 3
      app/models/form/sales/questions/buyer1_nationality.rb
  30. 3
      app/models/form/sales/questions/buyer1_working_situation.rb
  31. 3
      app/models/form/sales/questions/buyer2_age_known.rb
  32. 3
      app/models/form/sales/questions/buyer2_ethnic_background_arab.rb
  33. 3
      app/models/form/sales/questions/buyer2_ethnic_background_asian.rb
  34. 3
      app/models/form/sales/questions/buyer2_ethnic_background_black.rb
  35. 3
      app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb
  36. 3
      app/models/form/sales/questions/buyer2_ethnic_background_white.rb
  37. 2
      app/models/form/sales/questions/buyer2_ethnic_group.rb
  38. 2
      app/models/form/sales/questions/buyer2_live_in_property.rb
  39. 2
      app/models/form/sales/questions/buyer2_nationality.rb
  40. 3
      app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
  41. 2
      app/models/form/sales/questions/buyer2_working_situation.rb
  42. 6
      app/models/form/sales/questions/buyer_interview.rb
  43. 10
      app/models/form/sales/questions/gender_identity1.rb
  44. 8
      app/models/form/sales/questions/gender_identity2.rb
  45. 2
      app/models/form/sales/questions/nationality_all.rb
  46. 3
      app/models/form/sales/questions/nationality_all_group.rb
  47. 14
      app/models/form/sales/questions/number_of_others_in_property.rb
  48. 9
      app/models/form/sales/questions/person_age.rb
  49. 3
      app/models/form/sales/questions/person_age_known.rb
  50. 9
      app/models/form/sales/questions/person_gender_identity.rb
  51. 2
      app/models/form/sales/questions/person_known.rb
  52. 3
      app/models/form/sales/questions/person_relationship_to_buyer_1.rb
  53. 3
      app/models/form/sales/questions/person_working_situation.rb
  54. 6
      app/models/form/sales/questions/privacy_notice.rb
  55. 364
      config/locales/forms/2023/sales/household_characteristics.en.yml
  56. 352
      config/locales/forms/2024/sales/household_characteristics.en.yml
  57. 41
      spec/models/form/sales/pages/buyer_interview_spec.rb
  58. 31
      spec/models/form/sales/pages/privacy_notice_spec.rb
  59. 35
      spec/models/form/sales/questions/buyer_interview_spec.rb
  60. 32
      spec/models/form/sales/questions/privacy_notice_spec.rb

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Age2 < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_age"
@copy_key = "sales.household_characteristics.age2.buyer"
@depends_on = [
{
"joint_purchase?" => true,

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundArab < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_ethnic_background_arab"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@depends_on = [{
"ethnic_group" => 4,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundAsian < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_ethnic_background_asian"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@depends_on = [{
"ethnic_group" => 2,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundBlack < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_ethnic_background_black"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_black"
@depends_on = [{
"ethnic_group" => 3,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundMixed < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_ethnic_background_mixed"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed"
@depends_on = [{
"ethnic_group" => 1,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundWhite < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_ethnic_background_white"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_white"
@depends_on = [{
"ethnic_group" => 0,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundArab < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_ethnic_background_arab"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab"
@depends_on = [{
"ethnic_group2" => 4,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundAsian < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_ethnic_background_asian"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian"
@depends_on = [{
"ethnic_group2" => 2,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundBlack < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_ethnic_background_black"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@depends_on = [{
"ethnic_group2" => 3,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundMixed < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_ethnic_background_mixed"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@depends_on = [{
"ethnic_group2" => 1,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundWhite < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_ethnic_background_white"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white"
@depends_on = [{
"ethnic_group2" => 0,
}]

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2RelationshipToBuyer1 < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_relationship_to_buyer_1"
@copy_key = "sales.household_characteristics.relat2.buyer"
@depends_on = [
{
"joint_purchase?" => true,

6
app/models/form/sales/pages/buyer_interview.rb

@ -2,7 +2,11 @@ class Form::Sales::Pages::BuyerInterview < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
@copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@copy_key = if form.start_year_after_2024?
"sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
else
"sales.household_characteristics.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
end
def questions

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonAge < Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:)
super
@copy_key = "sales.household_characteristics.age2.person" if person_index == 2
@depends_on = [{ "details_known_#{person_index}" => 1 }]
end

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonGenderIdentity < Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:)
super
@copy_key = "sales.household_characteristics.sex2.person" if person_index == 2
@depends_on = [
{ "details_known_#{person_index}" => 1 },
]

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonRelationshipToBuyer1 < ::Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:)
super
@copy_key = "sales.household_characteristics.relat2.person" if person_index == 2
@depends_on = [
{ "details_known_#{person_index}" => 1 },
]

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

@ -1,6 +1,7 @@
class Form::Sales::Pages::PersonWorkingSituation < Form::Sales::Pages::Person
def initialize(id, hsh, subsection, person_index:)
super
@copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2
@depends_on = [
{
"details_known_#{person_index}" => 1,

6
app/models/form/sales/pages/privacy_notice.rb

@ -1,7 +1,11 @@
class Form::Sales::Pages::PrivacyNotice < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@copy_key = if form.start_year_after_2024?
"sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
else
"sales.household_characteristics.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
@joint_purchase = joint_purchase
end

2
app/models/form/sales/questions/age1.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Age1 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "age1"
@check_answer_label = "Buyer 1’s age"
@header = "Age"
@type = "numeric"
@width = 2
@inferred_check_answers_value = [

3
app/models/form/sales/questions/age2.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Age2 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "age2"
@check_answer_label = "Buyer 2’s age"
@header = "Age"
@copy_key = "sales.household_characteristics.age2.buyer"
@type = "numeric"
@width = 2
@inferred_check_answers_value = [{

3
app/models/form/sales/questions/buyer1_age_known.rb

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "age1_known"
@check_answer_label = "Buyer 1’s age"
@header = "Do you know buyer 1’s age?"
@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."
@conditional_for = {
"age1" => [0],
}

4
app/models/form/sales/questions/buyer1_ethnic_background_arab.rb

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundArab < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background"
@header = "Which of the following best describes buyer 1’s Arab background?"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

4
app/models/form/sales/questions/buyer1_ethnic_background_asian.rb

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundAsian < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background"
@header = "Which of the following best describes buyer 1’s Asian or Asian British background?"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

4
app/models/form/sales/questions/buyer1_ethnic_background_black.rb

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundBlack < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background"
@header = "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_black"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

4
app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundMixed < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background"
@header = "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

4
app/models/form/sales/questions/buyer1_ethnic_background_white.rb

@ -2,10 +2,8 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background"
@header = "Which of the following best describes buyer 1’s White background?"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_white"
@type = "radio"
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/sales/questions/buyer1_ethnic_group.rb

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic_group"
@check_answer_label = "Buyer 1’s ethnic group"
@header = "What is buyer 1’s ethnic group?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/sales/questions/buyer1_live_in_property.rb

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1LiveInProperty < ::Form::Question
def initialize(id, hsh, page)
super
@id = "buy1livein"
@check_answer_label = "Will buyer 1 live in the property?"
@header = "Will buyer 1 live in the property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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 = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/sales/questions/buyer1_nationality.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer1Nationality < ::Form::Question
def initialize(id, hsh, page)
super
@id = "national"
@check_answer_label = "Buyer 1’s nationality"
@header = "What is buyer 1’s nationality?"
@type = "radio"
@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
@inferred_check_answers_value = [{

3
app/models/form/sales/questions/buyer1_working_situation.rb

@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ecstat1"
@check_answer_label = "Buyer 1's working situation"
@header = "Which of these best describes buyer 1's working situation?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = form.start_year_after_2024? ? "" : "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
@inferred_check_answers_value = [{
"condition" => {

3
app/models/form/sales/questions/buyer2_age_known.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2AgeKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "age2_known"
@check_answer_label = "Buyer 2’s age"
@header = "Do you know buyer 2’s age?"
@copy_key = "sales.household_characteristics.age2_known.buyer"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@conditional_for = {

3
app/models/form/sales/questions/buyer2_ethnic_background_arab.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundArab < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background"
@header = "Which of the following best describes buyer 2’s Arab background?"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

3
app/models/form/sales/questions/buyer2_ethnic_background_asian.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background"
@header = "Which of the following best describes buyer 2’s Asian or Asian British background?"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

3
app/models/form/sales/questions/buyer2_ethnic_background_black.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background"
@header = "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

3
app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background"
@header = "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_mixed"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

3
app/models/form/sales/questions/buyer2_ethnic_background_white.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background"
@header = "Which of the following best describes buyer 2’s White background?"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white"
@type = "radio"
@check_answers_card_number = 2
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

2
app/models/form/sales/questions/buyer2_ethnic_group.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ethnic_group2"
@check_answer_label = "Buyer 2’s ethnic group"
@header = "What is buyer 2’s ethnic group?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

2
app/models/form/sales/questions/buyer2_live_in_property.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2LiveInProperty < ::Form::Question
def initialize(id, hsh, page)
super
@id = "buy2livein"
@check_answer_label = "Will buyer 2 live in the property?"
@header = "Will buyer 2 live in the property?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

2
app/models/form/sales/questions/buyer2_nationality.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2Nationality < ::Form::Question
def initialize(id, hsh, page)
super
@id = "nationalbuy2"
@check_answer_label = "Buyer 2’s nationality"
@header = "What is buyer 2’s nationality?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

3
app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "relat2"
@check_answer_label = "Buyer 2's relationship to buyer 1"
@header = "What is buyer 2's relationship to buyer 1?"
@copy_key = "sales.household_characteristics.relat2.buyer"
@type = "radio"
@answer_options = answer_options
@check_answers_card_number = 2

2
app/models/form/sales/questions/buyer2_working_situation.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ecstat2"
@check_answer_label = "Buyer 2's working situation"
@header = "Which of these best describes buyer 2's working situation?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2

6
app/models/form/sales/questions/buyer_interview.rb

@ -2,7 +2,11 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "noint"
@copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@copy_key = if form.start_year_after_2024?
"sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
else
"sales.household_characteristics.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
@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]

10
app/models/form/sales/questions/gender_identity1.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "sex1"
@check_answer_label = "Buyer 1’s gender identity"
@header = "Which of these best describes buyer 1’s gender identity?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1
@ -17,13 +15,5 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
"R" => { "value" => "Prefers not to say" },
}.freeze
def hint_text
if form.start_year_after_2024?
"This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
else
"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."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 21, 2024 => 23 }.freeze
end

8
app/models/form/sales/questions/gender_identity2.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "sex2"
@check_answer_label = "Buyer 2’s gender identity"
@header = "Which of these best describes buyer 2’s gender identity?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2
@ -23,11 +21,5 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
"R" => { "value" => "Buyer prefers not to say" },
}.freeze
def hint_text
return unless form.start_year_after_2024?
"This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 31 }.freeze
end

2
app/models/form/sales/questions/nationality_all.rb

@ -1,8 +1,6 @@
class Form::Sales::Questions::NationalityAll < ::Form::Question
def initialize(id, hsh, page, buyer_index)
super(id, hsh, page)
@check_answer_label = "Buyer #{buyer_index}’s nationality"
@header = "Enter a nationality"
@type = "select"
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS
@check_answers_card_number = buyer_index

3
app/models/form/sales/questions/nationality_all_group.rb

@ -1,10 +1,7 @@
class Form::Sales::Questions::NationalityAllGroup < ::Form::Question
def initialize(id, hsh, page, buyer_index)
super(id, hsh, page)
@check_answer_label = "Buyer #{buyer_index}’s nationality"
@header = "What is buyer #{buyer_index}’s nationality?"
@type = "radio"
@hint_text = "If buyer #{buyer_index} is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter."
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = buyer_index
@conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] }

14
app/models/form/sales/questions/number_of_others_in_property.rb

@ -2,10 +2,8 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "hholdcount"
@check_answer_label = "Number of other people living in the property"
@header = "Besides the #{'buyer'.pluralize(joint_purchase ? 2 : 1)}, how many other people live or will live in the property?"
@copy_key = joint_purchase ? "sales.household_characteristics.hholdcount.joint_purchase" : "sales.household_characteristics.hholdcount.not_joint_purchase"
@type = "numeric"
@hint_text = hint(joint_purchase)
@width = 2
@min = 0
@max = 15
@ -13,15 +11,5 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
private
def hint(joint_purchase)
if joint_purchase
"You can provide details for a maximum of 4 other people for a joint purchase."
else
"You can provide details for a maximum of 5 other people if there is only one buyer."
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 37 }.freeze
end

9
app/models/form/sales/questions/person_age.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonAge < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s age"
@header = "Age"
@type = "numeric"
@copy_key = "sales.household_characteristics.age2.person" if person_index == 2
@width = 3
@inferred_check_answers_value = [{
"condition" => { "age#{person_index}_known" => 1 },
@ -27,10 +26,4 @@ class Form::Sales::Questions::PersonAge < ::Form::Question
base_question_number + (4 * @person_index)
end
def hint_text
if form.start_year_after_2024?
"Answer 1 for children aged under 1 year old"
end
end
end

3
app/models/form/sales/questions/person_age_known.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonAgeKnown < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s age known?"
@header = "Do you know person #{person_index}’s age?"
@type = "radio"
@copy_key = "sales.household_characteristics.age2_known.person" if person_index == 2
@answer_options = ANSWER_OPTIONS
@conditional_for = {
"age#{person_index}" => [0],

9
app/models/form/sales/questions/person_gender_identity.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s gender identity"
@header = "Which of these best describes Person #{person_index}’s gender identity?"
@type = "radio"
@copy_key = "sales.household_characteristics.sex2.person" if person_index == 2
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = person_index
@inferred_check_answers_value = [{
@ -23,12 +22,6 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
"R" => { "value" => "Person prefers not to say" },
}.freeze
def hint_text
return unless form.start_year_after_2024?
"This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
end
def question_number
base_question_number = case form.start_date.year
when 2023

2
app/models/form/sales/questions/person_known.rb

@ -1,8 +1,6 @@
class Form::Sales::Questions::PersonKnown < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@check_answer_label = "Details known for person #{person_index}?"
@header = "Do you know the details for person #{person_index}?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_number = person_index

3
app/models/form/sales/questions/person_relationship_to_buyer_1.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s relationship to Buyer 1"
@header = "What is Person #{person_index}’s relationship to Buyer 1?"
@type = "radio"
@copy_key = "sales.household_characteristics.relat2.person" if person_index == 2
@answer_options = answer_options
@check_answers_card_number = person_index
@inferred_check_answers_value = [{

3
app/models/form/sales/questions/person_working_situation.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s working situation"
@header = "Which of these best describes Person #{person_index}’s working situation?"
@type = "radio"
@copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2
@check_answers_card_number = person_index
@inferred_check_answers_value = [{
"condition" => {

6
app/models/form/sales/questions/privacy_notice.rb

@ -2,7 +2,11 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "privacynotice"
@copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@copy_key = if form.start_year_after_2024?
"sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
else
"sales.household_characteristics.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
@type = "checkbox"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@joint_purchase = joint_purchase

364
config/locales/forms/2023/sales/household_characteristics.en.yml

@ -0,0 +1,364 @@
en:
forms:
2023:
sales:
household_characteristics:
noint:
joint_purchase:
page_header: ""
check_answer_label: "Buyers interviewed in person?"
hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person"
question_text: "Were the buyers interviewed for any of the answers you will provide on this log?"
not_joint_purchase:
page_header: ""
check_answer_label: "Buyer interviewed in person?"
hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person"
question_text: "Was the buyer interviewed for any of the answers you will provide on this log?"
privacynotice:
joint_purchase:
page_header: ""
check_answer_label: "Buyers have seen the privacy notice?"
hint_text: ""
question_text: "Declaration"
not_joint_purchase:
page_header: ""
check_answer_label: "Buyer has seen the privacy notice?"
hint_text: ""
question_text: "Declaration"
age1_known:
page_header: ""
check_answer_label: "Buyer 1’s age"
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."
question_text: "Do you know buyer 1’s age?"
age1:
page_header: ""
check_answer_label: "Buyer 1’s age"
hint_text: ""
question_text: "Age"
sex1:
page_header: ""
check_answer_label: "Buyer 1’s gender identity"
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."
question_text: "Which of these best describes buyer 1’s gender identity?"
ethnic_group:
page_header: ""
check_answer_label: "Buyer 1’s ethnic group"
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."
question_text: "What is buyer 1’s ethnic group?"
ethnic:
ethnic_background_black:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
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."
question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
ethnic_background_asian:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
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."
question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?"
ethnic_background_arab:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
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."
question_text: "Which of the following best describes buyer 1’s Arab background?"
ethnic_background_mixed:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
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."
question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
ethnic_background_white:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
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."
question_text: "Which of the following best describes buyer 1’s White background?"
national:
page_header: ""
check_answer_label: "Buyer 1’s nationality"
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."
question_text: "What is buyer 1’s nationality?"
ecstat1:
page_header: ""
check_answer_label: "Buyer 1's working situation"
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."
question_text: "Which of these best describes buyer 1's working situation?"
buy1livein:
page_header: ""
check_answer_label: "Will buyer 1 live in the property?"
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."
question_text: "Will buyer 1 live in the property?"
relat2:
buyer:
page_header: ""
check_answer_label: "Buyer 2's relationship to buyer 1"
hint_text: ""
question_text: "What is buyer 2's relationship to buyer 1?"
person:
page_header: ""
check_answer_label: "Person 2’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 2’s relationship to Buyer 1?"
age2_known:
buyer:
page_header: ""
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Do you know buyer 2’s age?"
person:
page_header: ""
check_answer_label: "Person 2’s age known?"
hint_text: ""
question_text: "Do you know person 2’s age?"
age2:
buyer:
page_header: ""
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Age"
person:
page_header: ""
check_answer_label: "Person 2’s age"
hint_text: ""
question_text: "Age"
sex2:
buyer:
page_header: ""
check_answer_label: "Buyer 2’s gender identity"
hint_text: ""
question_text: "Which of these best describes buyer 2’s gender identity?"
person:
page_header: ""
check_answer_label: "Person 2’s gender identity"
hint_text: ""
question_text: "Which of these best describes Person 2’s gender identity?"
ethnic_group2:
page_header: ""
check_answer_label: "Buyer 2’s ethnic group"
hint_text: ""
question_text: "What is buyer 2’s ethnic group?"
ethnicbuy2:
ethnic_background_black:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
ethnic_background_asian:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?"
ethnic_background_arab:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Arab background?"
ethnic_background_mixed:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
ethnic_background_white:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s White background?"
nationalbuy2:
page_header: ""
check_answer_label: "Buyer 2’s nationality"
hint_text: ""
question_text: "What is buyer 2’s nationality?"
ecstat2:
buyer:
page_header: ""
check_answer_label: "Buyer 2's working situation"
hint_text: ""
question_text: "Which of these best describes buyer 2's working situation?"
person:
page_header: ""
check_answer_label: "Person 2’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 2’s working situation?"
buy2livein:
page_header: ""
check_answer_label: "Will buyer 2 live in the property?"
hint_text: ""
question_text: "Will buyer 2 live in the property?"
hholdcount:
joint_purchase:
page_header: ""
check_answer_label: "Number of other people living in the property"
hint_text: "You can provide details for a maximum of 4 other people for a joint purchase."
question_text: "Besides the buyers, how many other people live or will live in the property?"
not_joint_purchase:
page_header: ""
check_answer_label: "Number of other people living in the property"
hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer."
question_text: "Besides the buyer, how many other people live or will live in the property?"
details_known_2:
page_header: ""
check_answer_label: "Details known for person 2?"
hint_text: ""
question_text: "Do you know the details for person 2?"
details_known_3:
page_header: ""
check_answer_label: "Details known for person 3?"
hint_text: ""
question_text: "Do you know the details for person 3?"
relat3:
page_header: ""
check_answer_label: "Person 3’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 3’s relationship to Buyer 1?"
age3_known:
page_header: ""
check_answer_label: "Person 3’s age known?"
hint_text: ""
question_text: "Do you know person 3’s age?"
age3:
page_header: ""
check_answer_label: "Person 3’s age"
hint_text: ""
question_text: "Age"
sex3:
page_header: ""
check_answer_label: "Person 3’s gender identity"
hint_text: ""
question_text: "Which of these best describes Person 3’s gender identity?"
ecstat3:
page_header: ""
check_answer_label: "Person 3’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 3’s working situation?"
details_known_4:
page_header: ""
check_answer_label: "Details known for person 4?"
hint_text: ""
question_text: "Do you know the details for person 4?"
relat4:
page_header: ""
check_answer_label: "Person 4’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 4’s relationship to Buyer 1?"
age4_known:
page_header: ""
check_answer_label: "Person 4’s age known?"
hint_text: ""
question_text: "Do you know person 4’s age?"
age4:
page_header: ""
check_answer_label: "Person 4’s age"
hint_text: ""
question_text: "Age"
sex4:
page_header: ""
check_answer_label: "Person 4’s gender identity"
hint_text: ""
question_text: "Which of these best describes Person 4’s gender identity?"
ecstat4:
page_header: ""
check_answer_label: "Person 4’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 4’s working situation?"
details_known_5:
page_header: ""
check_answer_label: "Details known for person 5?"
hint_text: ""
question_text: "Do you know the details for person 5?"
relat5:
page_header: ""
check_answer_label: "Person 5’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 5’s relationship to Buyer 1?"
age5_known:
page_header: ""
check_answer_label: "Person 5’s age known?"
hint_text: ""
question_text: "Do you know person 5’s age?"
age5:
page_header: ""
check_answer_label: "Person 5’s age"
hint_text: ""
question_text: "Age"
sex5:
page_header: ""
check_answer_label: "Person 5’s gender identity"
hint_text: ""
question_text: "Which of these best describes Person 5’s gender identity?"
ecstat5:
page_header: ""
check_answer_label: "Person 5’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 5’s working situation?"
details_known_6:
page_header: ""
check_answer_label: "Details known for person 6?"
hint_text: ""
question_text: "Do you know the details for person 6?"
relat6:
page_header: ""
check_answer_label: "Person 6’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 6’s relationship to Buyer 1?"
age6_known:
page_header: ""
check_answer_label: "Person 6’s age known?"
hint_text: ""
question_text: "Do you know person 6’s age?"
age6:
page_header: ""
check_answer_label: "Person 6’s age"
hint_text: ""
question_text: "Age"
sex6:
page_header: ""
check_answer_label: "Person 6’s gender identity"
hint_text: ""
question_text: "Which of these best describes Person 6’s gender identity?"
ecstat6:
page_header: ""
check_answer_label: "Person 6’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 6’s working situation?"

352
config/locales/forms/2024/sales/household_characteristics.en.yml

@ -0,0 +1,352 @@
en:
forms:
2024:
sales:
household_characteristics:
age1_known:
page_header: ""
check_answer_label: "Buyer 1’s age"
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."
question_text: "Do you know buyer 1’s age?"
age1:
page_header: ""
check_answer_label: "Buyer 1’s age"
hint_text: ""
question_text: "Age"
sex1:
page_header: ""
check_answer_label: "Buyer 1’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes buyer 1’s gender identity?"
ethnic_group:
page_header: ""
check_answer_label: "Buyer 1’s ethnic group"
hint_text: ""
question_text: "What is buyer 1’s ethnic group?"
ethnic:
ethnic_background_black:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
ethnic_background_asian:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?"
ethnic_background_arab:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 1’s Arab background?"
ethnic_background_mixed:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
ethnic_background_white:
page_header: ""
check_answer_label: "Buyer 1’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 1’s White background?"
nationality_all_group:
page_header: ""
check_answer_label: "Buyer 1’s nationality"
hint_text: "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter."
question_text: "What is buyer 1’s nationality?"
nationality_all:
page_header: ""
check_answer_label: "Buyer 1’s nationality"
hint_text: ""
question_text: "Enter a nationality"
ecstat1:
page_header: ""
check_answer_label: "Buyer 1's working situation"
hint_text: ""
question_text: "Which of these best describes buyer 1's working situation?"
buy1livein:
page_header: ""
check_answer_label: "Will buyer 1 live in the property?"
hint_text: ""
question_text: "Will buyer 1 live in the property?"
relat2:
buyer:
page_header: ""
check_answer_label: "Buyer 2's relationship to buyer 1"
hint_text: ""
question_text: "What is buyer 2's relationship to buyer 1?"
person:
page_header: ""
check_answer_label: "Person 2’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 2’s relationship to Buyer 1?"
age2_known:
buyer:
page_header: ""
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Do you know buyer 2’s age?"
person:
page_header: ""
check_answer_label: "Person 2’s age known?"
hint_text: ""
question_text: "Do you know person 2’s age?"
age2:
buyer:
page_header: ""
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Age"
person:
page_header: ""
check_answer_label: "Person 2’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex2:
buyer:
page_header: ""
check_answer_label: "Buyer 2’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes buyer 2’s gender identity?"
person:
page_header: ""
check_answer_label: "Person 2’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes Person 2’s gender identity?"
ethnic_group2:
page_header: ""
check_answer_label: "Buyer 2’s ethnic group"
hint_text: ""
question_text: "What is buyer 2’s ethnic group?"
ethnicbuy2:
ethnic_background_black:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
ethnic_background_asian:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?"
ethnic_background_arab:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Arab background?"
ethnic_background_mixed:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
ethnic_background_white:
page_header: ""
check_answer_label: "Buyer 2’s ethnic background"
hint_text: ""
question_text: "Which of the following best describes buyer 2’s White background?"
nationality_all_buyer2_group:
page_header: ""
check_answer_label: "Buyer 2’s nationality"
hint_text: "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter."
question_text: "What is buyer 2’s nationality?"
nationality_all_buyer2:
page_header: ""
check_answer_label: "Buyer 2’s nationality"
hint_text: ""
question_text: "Enter a nationality"
ecstat2:
buyer:
page_header: ""
check_answer_label: "Buyer 2's working situation"
hint_text: ""
question_text: "Which of these best describes buyer 2's working situation?"
person:
page_header: ""
check_answer_label: "Person 2’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 2’s working situation?"
buy2livein:
page_header: ""
check_answer_label: "Will buyer 2 live in the property?"
hint_text: ""
question_text: "Will buyer 2 live in the property?"
hholdcount:
joint_purchase:
page_header: ""
check_answer_label: "Number of other people living in the property"
hint_text: "You can provide details for a maximum of 4 other people for a joint purchase."
question_text: "Besides the buyers, how many other people live or will live in the property?"
not_joint_purchase:
page_header: ""
check_answer_label: "Number of other people living in the property"
hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer."
question_text: "Besides the buyer, how many other people live or will live in the property?"
details_known_2:
page_header: ""
check_answer_label: "Details known for person 2?"
hint_text: ""
question_text: "Do you know the details for person 2?"
details_known_3:
page_header: ""
check_answer_label: "Details known for person 3?"
hint_text: ""
question_text: "Do you know the details for person 3?"
relat3:
page_header: ""
check_answer_label: "Person 3’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 3’s relationship to Buyer 1?"
age3_known:
page_header: ""
check_answer_label: "Person 3’s age known?"
hint_text: ""
question_text: "Do you know person 3’s age?"
age3:
page_header: ""
check_answer_label: "Person 3’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex3:
page_header: ""
check_answer_label: "Person 3’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes Person 3’s gender identity?"
ecstat3:
page_header: ""
check_answer_label: "Person 3’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 3’s working situation?"
details_known_4:
page_header: ""
check_answer_label: "Details known for person 4?"
hint_text: ""
question_text: "Do you know the details for person 4?"
relat4:
page_header: ""
check_answer_label: "Person 4’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 4’s relationship to Buyer 1?"
age4_known:
page_header: ""
check_answer_label: "Person 4’s age known?"
hint_text: ""
question_text: "Do you know person 4’s age?"
age4:
page_header: ""
check_answer_label: "Person 4’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex4:
page_header: ""
check_answer_label: "Person 4’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes Person 4’s gender identity?"
ecstat4:
page_header: ""
check_answer_label: "Person 4’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 4’s working situation?"
details_known_5:
page_header: ""
check_answer_label: "Details known for person 5?"
hint_text: ""
question_text: "Do you know the details for person 5?"
relat5:
page_header: ""
check_answer_label: "Person 5’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 5’s relationship to Buyer 1?"
age5_known:
page_header: ""
check_answer_label: "Person 5’s age known?"
hint_text: ""
question_text: "Do you know person 5’s age?"
age5:
page_header: ""
check_answer_label: "Person 5’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex5:
page_header: ""
check_answer_label: "Person 5’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes Person 5’s gender identity?"
ecstat5:
page_header: ""
check_answer_label: "Person 5’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 5’s working situation?"
details_known_6:
page_header: ""
check_answer_label: "Details known for person 6?"
hint_text: ""
question_text: "Do you know the details for person 6?"
relat6:
page_header: ""
check_answer_label: "Person 6’s relationship to Buyer 1"
hint_text: ""
question_text: "What is Person 6’s relationship to Buyer 1?"
age6_known:
page_header: ""
check_answer_label: "Person 6’s age known?"
hint_text: ""
question_text: "Do you know person 6’s age?"
age6:
page_header: ""
check_answer_label: "Person 6’s age"
hint_text: "Answer 1 for children aged under 1 year old"
question_text: "Age"
sex6:
page_header: ""
check_answer_label: "Person 6’s gender identity"
hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth."
question_text: "Which of these best describes Person 6’s gender identity?"
ecstat6:
page_header: ""
check_answer_label: "Person 6’s working situation"
hint_text: ""
question_text: "Which of these best describes Person 6’s working situation?"

41
spec/models/form/sales/pages/buyer_interview_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do
let(:page_id) { "buyer_interview" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@ -23,19 +24,41 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do
expect(page.description).to be_nil
end
context "when there are joint buyers" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) }
context "when form is before 2024" do
context "when there are joint buyers" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.noint.joint_purchase")
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.household_characteristics.noint.joint_purchase")
end
end
context "when there is a single buyer" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase")
end
end
end
context "when there is a single buyer" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) }
context "when form is after 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
context "when there are joint buyers" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.noint.joint_purchase")
end
end
context "when there is a single buyer" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase")
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase")
end
end
end
end

31
spec/models/form/sales/pages/privacy_notice_spec.rb

@ -6,11 +6,10 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
let(:page_id) { "privacy_notice" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) }
before do
allow(subsection).to receive(:form).and_return(form)
allow(form).to receive(:start_year_after_2024?)
end
it "has correct subsection" do
@ -32,8 +31,18 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
context "when there are joint buyers" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
context "when the form start year is before 2024" do
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase")
end
end
context "when the form start year is after 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
end
end
it "has correct depends_on" do
@ -44,8 +53,18 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
context "when there is a single buyer" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
context "when the form start year is before 2024" do
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase")
end
end
context "when the form start year is after 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
end
end
it "has correct depends_on" do

35
spec/models/form/sales/questions/buyer_interview_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: true) }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:)) }
it "has correct page" do
expect(question.page).to eq(page)
@ -33,16 +34,40 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do
context "when there are joint buyers" do
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.noint.joint_purchase")
context "when the form start year is before 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 3, 1), start_year_after_2024?: false) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.household_characteristics.noint.joint_purchase")
end
end
context "when the form start year is after 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.noint.joint_purchase")
end
end
end
context "when there is a single buyer" do
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase")
context "when the form start year is before 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase")
end
end
context "when the form start year is after 2024" do
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase")
end
end
end
end

32
spec/models/form/sales/questions/privacy_notice_spec.rb

@ -31,22 +31,6 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
expect(question.derived?(nil)).to be false
end
context "when there are joint buyers" do
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
end
end
context "when there is a single buyer" do
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) }
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
end
end
context "when the form year is before 2024" do
before do
allow(form).to receive(:start_year_after_2024?).and_return(false)
@ -66,6 +50,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyer before you can submit this log.")
end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase")
end
end
context "and there are joint buyers" do
@ -84,6 +72,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyers before you can submit this log.")
end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase")
end
end
end
@ -106,6 +98,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show or give the buyer access to the MHCLG privacy notice before you can submit this log.")
end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
end
end
context "and there are joint buyers" do
@ -124,6 +120,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" do
expect(question.unanswered_error_message).to eq("You must show or give the buyers access to the MHCLG privacy notice before you can submit this log.")
end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
end
end
end
end

Loading…
Cancel
Save