Browse Source

CLDC-3656 Extract household characteristics question and page copy to translation files (#2702)

* Extract question and page copy to translation files

* Refactor 2 question pages

* Readd removed answer options

* Fix missing/wrong age mappings

* Update some pages/questions

* Update tests

* CLDC-3656 Extract household characteristics soft validations (#2707)

* Extract retirement confirmation questions

* Extract old persons shared ownership confirmation questions

* Extract income confirmation questions

* Extract buyer live-in value check page and question copy to translation files

* Extract student not a child confirmation questions and page copy to translation files

* Extract partner under 16 value check page and question copy to translation files

* Extract partner under 16 value check page and question copy to translation files

* Update some missing/wrong keys

* Update some keys on 2023

* Update BU tests
pull/2723/head^2
kosiakkatrina 4 months ago committed by GitHub
parent
commit
1ffc440342
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/models/form/sales/pages/age1.rb
  2. 1
      app/models/form/sales/pages/age2.rb
  3. 1
      app/models/form/sales/pages/buyer1_ethnic_background_arab.rb
  4. 1
      app/models/form/sales/pages/buyer1_ethnic_background_asian.rb
  5. 1
      app/models/form/sales/pages/buyer1_ethnic_background_black.rb
  6. 1
      app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb
  7. 1
      app/models/form/sales/pages/buyer1_ethnic_background_white.rb
  8. 1
      app/models/form/sales/pages/buyer2_ethnic_background_arab.rb
  9. 1
      app/models/form/sales/pages/buyer2_ethnic_background_asian.rb
  10. 1
      app/models/form/sales/pages/buyer2_ethnic_background_black.rb
  11. 1
      app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb
  12. 1
      app/models/form/sales/pages/buyer2_ethnic_background_white.rb
  13. 1
      app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb
  14. 1
      app/models/form/sales/pages/buyer2_working_situation.rb
  15. 2
      app/models/form/sales/pages/buyer_interview.rb
  16. 5
      app/models/form/sales/pages/buyer_live_in_value_check.rb
  17. 1
      app/models/form/sales/pages/gender_identity2.rb
  18. 8
      app/models/form/sales/pages/multiple_partners_value_check.rb
  19. 6
      app/models/form/sales/pages/not_retired_value_check.rb
  20. 5
      app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb
  21. 8
      app/models/form/sales/pages/partner_under_16_value_check.rb
  22. 1
      app/models/form/sales/pages/person_age.rb
  23. 1
      app/models/form/sales/pages/person_gender_identity.rb
  24. 1
      app/models/form/sales/pages/person_relationship_to_buyer_1.rb
  25. 5
      app/models/form/sales/pages/person_student_not_child_value_check.rb
  26. 1
      app/models/form/sales/pages/person_working_situation.rb
  27. 2
      app/models/form/sales/pages/privacy_notice.rb
  28. 8
      app/models/form/sales/pages/retirement_value_check.rb
  29. 3
      app/models/form/sales/questions/age1.rb
  30. 3
      app/models/form/sales/questions/age2.rb
  31. 4
      app/models/form/sales/questions/buyer1_age_known.rb
  32. 4
      app/models/form/sales/questions/buyer1_ethnic_background_arab.rb
  33. 4
      app/models/form/sales/questions/buyer1_ethnic_background_asian.rb
  34. 4
      app/models/form/sales/questions/buyer1_ethnic_background_black.rb
  35. 4
      app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb
  36. 4
      app/models/form/sales/questions/buyer1_ethnic_background_white.rb
  37. 3
      app/models/form/sales/questions/buyer1_ethnic_group.rb
  38. 3
      app/models/form/sales/questions/buyer1_live_in_property.rb
  39. 3
      app/models/form/sales/questions/buyer1_nationality.rb
  40. 3
      app/models/form/sales/questions/buyer1_working_situation.rb
  41. 3
      app/models/form/sales/questions/buyer2_age_known.rb
  42. 3
      app/models/form/sales/questions/buyer2_ethnic_background_arab.rb
  43. 3
      app/models/form/sales/questions/buyer2_ethnic_background_asian.rb
  44. 3
      app/models/form/sales/questions/buyer2_ethnic_background_black.rb
  45. 3
      app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb
  46. 3
      app/models/form/sales/questions/buyer2_ethnic_background_white.rb
  47. 2
      app/models/form/sales/questions/buyer2_ethnic_group.rb
  48. 2
      app/models/form/sales/questions/buyer2_live_in_property.rb
  49. 2
      app/models/form/sales/questions/buyer2_nationality.rb
  50. 3
      app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb
  51. 3
      app/models/form/sales/questions/buyer2_working_situation.rb
  52. 2
      app/models/form/sales/questions/buyer_interview.rb
  53. 3
      app/models/form/sales/questions/buyer_live_in_value_check.rb
  54. 10
      app/models/form/sales/questions/gender_identity1.rb
  55. 9
      app/models/form/sales/questions/gender_identity2.rb
  56. 3
      app/models/form/sales/questions/multiple_partners_value_check.rb
  57. 2
      app/models/form/sales/questions/nationality_all.rb
  58. 3
      app/models/form/sales/questions/nationality_all_group.rb
  59. 3
      app/models/form/sales/questions/not_retired_value_check.rb
  60. 14
      app/models/form/sales/questions/number_of_others_in_property.rb
  61. 3
      app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb
  62. 3
      app/models/form/sales/questions/partner_under_16_value_check.rb
  63. 9
      app/models/form/sales/questions/person_age.rb
  64. 3
      app/models/form/sales/questions/person_age_known.rb
  65. 9
      app/models/form/sales/questions/person_gender_identity.rb
  66. 2
      app/models/form/sales/questions/person_known.rb
  67. 3
      app/models/form/sales/questions/person_relationship_to_buyer_1.rb
  68. 3
      app/models/form/sales/questions/person_student_not_child_value_check.rb
  69. 3
      app/models/form/sales/questions/person_working_situation.rb
  70. 2
      app/models/form/sales/questions/privacy_notice.rb
  71. 3
      app/models/form/sales/questions/retirement_value_check.rb
  72. 17
      config/locales/en.yml
  73. 357
      config/locales/forms/2023/sales/household_characteristics.en.yml
  74. 66
      config/locales/forms/2023/sales/soft_validations.en.yml
  75. 345
      config/locales/forms/2024/sales/household_characteristics.en.yml
  76. 66
      config/locales/forms/2024/sales/soft_validations.en.yml
  77. 27
      spec/models/form/sales/pages/buyer_interview_spec.rb
  78. 7
      spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb
  79. 11
      spec/models/form/sales/pages/multiple_partners_value_check_spec.rb
  80. 9
      spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb
  81. 27
      spec/models/form/sales/pages/partner_under16_value_check_spec.rb
  82. 7
      spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb
  83. 29
      spec/models/form/sales/pages/privacy_notice_spec.rb
  84. 27
      spec/models/form/sales/pages/retirement_value_check_spec.rb
  85. 29
      spec/models/form/sales/questions/buyer_interview_spec.rb
  86. 36
      spec/models/form/sales/questions/privacy_notice_spec.rb
  87. 4
      spec/services/bulk_upload/sales/year2023/row_parser_spec.rb
  88. 4
      spec/services/bulk_upload/sales/year2024/row_parser_spec.rb

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Age1 < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_age" @id = "buyer_1_age"
@copy_key = "sales.household_characteristics.age1"
@depends_on = [ @depends_on = [
{ {
"buyer_has_seen_privacy_notice?" => true, "buyer_has_seen_privacy_notice?" => true,

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Age2 < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_age" @id = "buyer_2_age"
@copy_key = "sales.household_characteristics.age2.buyer"
@depends_on = [ @depends_on = [
{ {
"joint_purchase?" => true, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_ethnic_background_arab" @id = "buyer_1_ethnic_background_arab"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_arab"
@depends_on = [{ @depends_on = [{
"ethnic_group" => 4, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_ethnic_background_asian" @id = "buyer_1_ethnic_background_asian"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@depends_on = [{ @depends_on = [{
"ethnic_group" => 2, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_ethnic_background_black" @id = "buyer_1_ethnic_background_black"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_black"
@depends_on = [{ @depends_on = [{
"ethnic_group" => 3, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_ethnic_background_mixed" @id = "buyer_1_ethnic_background_mixed"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed"
@depends_on = [{ @depends_on = [{
"ethnic_group" => 1, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_1_ethnic_background_white" @id = "buyer_1_ethnic_background_white"
@copy_key = "sales.household_characteristics.ethnic.ethnic_background_white"
@depends_on = [{ @depends_on = [{
"ethnic_group" => 0, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_arab" @id = "buyer_2_ethnic_background_arab"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 4, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_asian" @id = "buyer_2_ethnic_background_asian"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 2, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_black" @id = "buyer_2_ethnic_background_black"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 3, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_mixed" @id = "buyer_2_ethnic_background_mixed"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 1, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_ethnic_background_white" @id = "buyer_2_ethnic_background_white"
@copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white"
@depends_on = [{ @depends_on = [{
"ethnic_group2" => 0, "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) def initialize(id, hsh, subsection)
super super
@id = "buyer_2_relationship_to_buyer_1" @id = "buyer_2_relationship_to_buyer_1"
@copy_key = "sales.household_characteristics.relat2.buyer"
@depends_on = [ @depends_on = [
{ {
"joint_purchase?" => true, "joint_purchase?" => true,

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

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

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

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

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

@ -6,12 +6,13 @@ class Form::Sales::Pages::BuyerLiveInValueCheck < Form::Sales::Pages::Person
"buyer#{person_index}_livein_wrong_for_ownership_type?" => true, "buyer#{person_index}_livein_wrong_for_ownership_type?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}"
@title_text = { @title_text = {
"translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
} }
end end

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

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

8
app/models/form/sales/pages/multiple_partners_value_check.rb

@ -6,12 +6,16 @@ class Form::Sales::Pages::MultiplePartnersValueCheck < Form::Sales::Pages::Perso
"multiple_partners?" => true, "multiple_partners?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.multiple_partners_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.multiple_partners_sales.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
@informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@informative_text = {}
end end
def questions def questions

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

@ -7,11 +7,13 @@ class Form::Sales::Pages::NotRetiredValueCheck < Form::Sales::Pages::Person
}, },
] ]
@person_index = person_index @person_index = person_index
@copy_key = "sales.soft_validations.retirement_value_check.max"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.max.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.retirement.max.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
} }
end end

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

@ -1,12 +1,13 @@
class Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck < ::Form::Page class Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:) def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection) super(id, hsh, subsection)
@copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.old_persons_shared_ownership.title_text.#{joint_purchase ? 'two' : 'one'}", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}",
"arguments" => [], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.old_persons_shared_ownership.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@joint_purchase = joint_purchase @joint_purchase = joint_purchase

8
app/models/form/sales/pages/partner_under_16_value_check.rb

@ -6,9 +6,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person
"person_#{person_index}_partner_under_16?" => true, "person_#{person_index}_partner_under_16?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.partner_under_16_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age#{person_index}", "key" => "age#{person_index}",
@ -17,7 +18,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

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

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

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

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

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

@ -6,11 +6,12 @@ class Form::Sales::Pages::PersonStudentNotChildValueCheck < Form::Sales::Pages::
"person_#{person_index}_student_not_child?" => true, "person_#{person_index}_student_not_child?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.student_not_child_value_check"
@person_index = person_index @person_index = person_index
@title_text = { @title_text = {
"translation" => "soft_validations.student_not_child.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = {} @informative_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [] }
end end
def questions def questions

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

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

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

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

8
app/models/form/sales/pages/retirement_value_check.rb

@ -7,8 +7,9 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person
}, },
] ]
@person_index = person_index @person_index = person_index
@copy_key = "sales.soft_validations.retirement_value_check.min"
@title_text = { @title_text = {
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age#{person_index}", "key" => "age#{person_index}",
@ -17,7 +18,10 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person
}, },
], ],
} }
@informative_text = {} @informative_text = {
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end end
def questions def questions

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

@ -2,10 +2,9 @@ class Form::Sales::Questions::Age1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1" @id = "age1"
@check_answer_label = "Buyer 1’s age"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@copy_key = "sales.household_characteristics.age1.age1"
@inferred_check_answers_value = [ @inferred_check_answers_value = [
{ {
"condition" => { "age1_known" => 1 }, "condition" => { "age1_known" => 1 },

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

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

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1_known" @id = "age1_known"
@check_answer_label = "Buyer 1’s age"
@header = "Do you know buyer 1’s age?"
@type = "radio" @type = "radio"
@copy_key = "sales.household_characteristics.age1.age1_known"
@answer_options = ANSWER_OPTIONS @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 = { @conditional_for = {
"age1" => [0], "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) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_arab"
@header = "Which of the following best describes buyer 1’s Arab background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian"
@header = "Which of the following best describes buyer 1’s Asian or Asian British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_black"
@header = "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed"
@header = "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Buyer 1’s ethnic background" @copy_key = "sales.household_characteristics.ethnic.ethnic_background_white"
@header = "Which of the following best describes buyer 1’s White background?"
@type = "radio" @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "ethnic_group" @id = "ethnic_group"
@check_answer_label = "Buyer 1’s ethnic group"
@header = "What is buyer 1’s ethnic group?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "buy1livein" @id = "buy1livein"
@check_answer_label = "Will buyer 1 live in the property?"
@header = "Will buyer 1 live in the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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) def initialize(id, hsh, page)
super super
@id = "national" @id = "national"
@check_answer_label = "Buyer 1’s nationality"
@header = "What is buyer 1’s nationality?"
@type = "radio" @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 @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1 @check_answers_card_number = 1
@inferred_check_answers_value = [{ @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) def initialize(id, hsh, page)
super super
@id = "ecstat1" @id = "ecstat1"
@check_answer_label = "Buyer 1's working situation"
@header = "Which of these best describes buyer 1's working situation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @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 @check_answers_card_number = 1
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "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) def initialize(id, hsh, page)
super super
@id = "age2_known" @id = "age2_known"
@check_answer_label = "Buyer 2’s age" @copy_key = "sales.household_characteristics.age2.buyer.age2_known"
@header = "Do you know buyer 2’s age?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { @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) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab"
@header = "Which of the following best describes buyer 2’s Arab background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian"
@header = "Which of the following best describes buyer 2’s Asian or Asian British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black"
@header = "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_mixed"
@header = "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "ethnicbuy2" @id = "ethnicbuy2"
@check_answer_label = "Buyer 2’s ethnic background" @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white"
@header = "Which of the following best describes buyer 2’s White background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 2 @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] @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) def initialize(id, hsh, page)
super super
@id = "ethnic_group2" @id = "ethnic_group2"
@check_answer_label = "Buyer 2’s ethnic group"
@header = "What is buyer 2’s ethnic group?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "buy2livein" @id = "buy2livein"
@check_answer_label = "Will buyer 2 live in the property?"
@header = "Will buyer 2 live in the property?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "nationalbuy2" @id = "nationalbuy2"
@check_answer_label = "Buyer 2’s nationality"
@header = "What is buyer 2’s nationality?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @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) def initialize(id, hsh, page)
super super
@id = "relat2" @id = "relat2"
@check_answer_label = "Buyer 2's relationship to buyer 1" @copy_key = "sales.household_characteristics.relat2.buyer"
@header = "What is buyer 2's relationship to buyer 1?"
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@check_answers_card_number = 2 @check_answers_card_number = 2

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

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

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question
def initialize(id, hsh, page, joint_purchase:) def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page) super(id, hsh, page)
@id = "noint" @id = "noint"
@copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @copy_key = "sales.#{subsection.id}.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "buyer_livein_value_check" @id = "buyer_livein_value_check"
@check_answer_label = "Buyer live in confirmation" @copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

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) def initialize(id, hsh, page)
super super
@id = "sex1" @id = "sex1"
@check_answer_label = "Buyer 1’s gender identity"
@header = "Which of these best describes buyer 1’s gender identity?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 1 @check_answers_card_number = 1
@ -17,13 +15,5 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
"R" => { "value" => "Prefers not to say" }, "R" => { "value" => "Prefers not to say" },
}.freeze }.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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 21, 2024 => 23 }.freeze
end end

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

@ -2,9 +2,8 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sex2" @id = "sex2"
@check_answer_label = "Buyer 2’s gender identity"
@header = "Which of these best describes buyer 2’s gender identity?"
@type = "radio" @type = "radio"
@copy_key = "sales.household_characteristics.sex2.buyer"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = 2 @check_answers_card_number = 2
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -23,11 +22,5 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question
"R" => { "value" => "Buyer prefers not to say" }, "R" => { "value" => "Buyer prefers not to say" },
}.freeze }.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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 31 }.freeze
end end

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "multiple_partners_value_check" @id = "multiple_partners_value_check"
@check_answer_label = "Multiple partners confirmation" @copy_key = "sales.soft_validations.multiple_partners_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

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

@ -1,8 +1,6 @@
class Form::Sales::Questions::NationalityAll < ::Form::Question class Form::Sales::Questions::NationalityAll < ::Form::Question
def initialize(id, hsh, page, buyer_index) def initialize(id, hsh, page, buyer_index)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Buyer #{buyer_index}’s nationality"
@header = "Enter a nationality"
@type = "select" @type = "select"
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS
@check_answers_card_number = buyer_index @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 class Form::Sales::Questions::NationalityAllGroup < ::Form::Question
def initialize(id, hsh, page, buyer_index) def initialize(id, hsh, page, buyer_index)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Buyer #{buyer_index}’s nationality"
@header = "What is buyer #{buyer_index}’s nationality?"
@type = "radio" @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 @answer_options = ANSWER_OPTIONS
@check_answers_card_number = buyer_index @check_answers_card_number = buyer_index
@conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] } @conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] }

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "retirement_value_check" @id = "retirement_value_check"
@check_answer_label = "Retirement confirmation" @copy_key = "sales.soft_validations.retirement_value_check.max"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this person isn't retired?"
end end
end end

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:) def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page) super(id, hsh, page)
@id = "hholdcount" @id = "hholdcount"
@check_answer_label = "Number of other people living in the property" @copy_key = joint_purchase ? "sales.household_characteristics.hholdcount.joint_purchase" : "sales.household_characteristics.hholdcount.not_joint_purchase"
@header = "Besides the #{'buyer'.pluralize(joint_purchase ? 2 : 1)}, how many other people live or will live in the property?"
@type = "numeric" @type = "numeric"
@hint_text = hint(joint_purchase)
@width = 2 @width = 2
@min = 0 @min = 0
@max = 15 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end 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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 37 }.freeze
end end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck < ::Form::Ques
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "old_persons_shared_ownership_value_check" @id = "old_persons_shared_ownership_value_check"
@check_answer_label = "Shared ownership confirmation" @copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "partner_under_16_value_check" @id = "partner_under_16_value_check"
@check_answer_label = "Partner under 16 confirmation" @copy_key = "sales.soft_validations.partner_under_16_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end end
end end

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

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

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

@ -1,10 +1,9 @@
class Form::Sales::Questions::PersonAgeKnown < ::Form::Question class Form::Sales::Questions::PersonAgeKnown < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@check_answer_label = "Person #{person_index}’s age known?"
@header = "Do you know person #{person_index}’s age?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@copy_key = person_index == 2 ? "sales.household_characteristics.age2.person.age2_known" : "sales.household_characteristics.age#{person_index}.age#{person_index}_known"
@conditional_for = { @conditional_for = {
"age#{person_index}" => [0], "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 class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) 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" @type = "radio"
@copy_key = "sales.household_characteristics.sex2.person" if person_index == 2
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -23,12 +22,6 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question
"R" => { "value" => "Person prefers not to say" }, "R" => { "value" => "Person prefers not to say" },
}.freeze }.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 def question_number
base_question_number = case form.start_date.year base_question_number = case form.start_date.year
when 2023 when 2023

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

@ -1,8 +1,6 @@
class Form::Sales::Questions::PersonKnown < ::Form::Question class Form::Sales::Questions::PersonKnown < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) 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" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@check_answers_card_number = person_index @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 class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) 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" @type = "radio"
@copy_key = "sales.household_characteristics.relat2.person" if person_index == 2
@answer_options = answer_options @answer_options = answer_options
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "student_not_child_value_check" @id = "student_not_child_value_check"
@check_answer_label = "Student not a child confirmation" @copy_key = "sales.soft_validations.student_not_child_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this person is not a child?"
end end
end end

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

@ -1,9 +1,8 @@
class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) 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" @type = "radio"
@copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {

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

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

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::RetirementValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "retirement_value_check" @id = "retirement_value_check"
@check_answer_label = "Retirement confirmation" @copy_key = "sales.soft_validations.retirement_value_check.min"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::RetirementValueCheck < ::Form::Question
], ],
} }
@check_answers_card_number = person_index @check_answers_card_number = person_index
@header = "Are you sure this person is retired?"
end end
end end

17
config/locales/en.yml

@ -724,30 +724,17 @@ Make sure these answers are correct."
hint_text: "This is higher than we would expect." hint_text: "This is higher than we would expect."
shared_ownership_deposit: shared_ownership_deposit:
title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}." title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
old_persons_shared_ownership:
title_text:
one: "You told us the buyer is using the Older Persons Shared Ownership scheme."
two: "You told us the buyers are using the Older Persons Shared Ownership scheme."
hint_text: "At least one buyer must be aged 65 years and over to use this scheme."
staircase_bought_seems_high: staircase_bought_seems_high:
title_text: "You told us that %{percentage}% was bought in this staircasing transaction." title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
hint_text: "Most staircasing transactions are less than 50%" hint_text: "Most staircasing transactions are less than 50%"
monthly_charges_over_soft_max: monthly_charges_over_soft_max:
title_text: "You told us that the monthly charges were %{mscharge}." title_text: "You told us that the monthly charges were %{mscharge}."
hint_text: "This is higher than we would expect." hint_text: "This is higher than we would expect."
student_not_child:
title_text: "You told us this person is a student aged between 16 and 19."
discounted_sale_value: discounted_sale_value:
title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}." title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}."
informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}." informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}."
care_home_charges: care_home_charges:
title_text: "Care home charges should be provided if this is a care home accommodation." title_text: "Care home charges should be provided if this is a care home accommodation."
buyer1_livein_wrong_for_ownership_type:
title_text: "You told us that buyer 1 will not live in the property."
hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property."
buyer2_livein_wrong_for_ownership_type:
title_text: "You told us that buyer 2 will not live in the property."
hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property."
percentage_discount_value: percentage_discount_value:
title_text: "You told us that the percentage discount is %{discount}." title_text: "You told us that the percentage discount is %{discount}."
hint_text: "This is higher than we would expect." hint_text: "This is higher than we would expect."
@ -783,12 +770,8 @@ Make sure these answers are correct."
informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually." informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually."
partner_under_16_lettings: partner_under_16_lettings:
title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant."
partner_under_16_sales:
title: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
multiple_partners_lettings: multiple_partners_lettings:
title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant."
multiple_partners_sales:
title: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
devise: devise:
two_factor_authentication: two_factor_authentication:

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

@ -0,0 +1,357 @@
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:
page_header: ""
age1_known:
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:
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:
buyer:
page_header: ""
age2_known:
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Do you know buyer 2’s age?"
age2:
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Age"
person:
page_header: ""
age2_known:
check_answer_label: "Person 2’s age known?"
hint_text: ""
question_text: "Do you know person 2’s age?"
age:
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:
page_header: ""
age3_known:
check_answer_label: "Person 3’s age known?"
hint_text: ""
question_text: "Do you know person 3’s age?"
age3:
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:
page_header: ""
age4_known:
check_answer_label: "Person 4’s age known?"
hint_text: ""
question_text: "Do you know person 4’s age?"
age4:
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:
page_header: ""
age5_known:
check_answer_label: "Person 5’s age known?"
hint_text: ""
question_text: "Do you know person 5’s age?"
age5:
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:
page_header: ""
age6_known:
check_answer_label: "Person 6’s age known?"
hint_text: ""
question_text: "Do you know person 6’s age?"
age6:
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?"

66
config/locales/forms/2023/sales/soft_validations.en.yml

@ -3,25 +3,51 @@ en:
2023: 2023:
sales: sales:
soft_validations: soft_validations:
income1_value_check: retirement_value_check:
max:
page_header: ""
check_answer_label: "Retirement confirmation"
hint_text: ""
question_text: "Are you sure this person isn't retired?"
title_text: "You told us this person is over 66 and not retired."
informative_text: "The minimum expected retirement age in England is 66."
min:
page_header: ""
check_answer_label: "Retirement confirmation"
hint_text: ""
question_text: "Are you sure this person is retired?"
title_text: "You told us this person is aged %{age} years and retired."
informative_text: "The minimum expected retirement age in England is 66."
old_persons_shared_ownership_value_check:
page_header: "" page_header: ""
check_answer_label: "Shared ownership confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text:
joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme."
not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme."
informative_text: "At least one buyer must be aged 65 years and over to use this scheme."
income1_value_check:
check_answer_label: "Buyer 1 income confirmation" check_answer_label: "Buyer 1 income confirmation"
hint_text: "" hint_text: ""
question_text: "Are you sure this is correct?" question_text: "Are you sure this is correct?"
min: min:
page_header: ""
title_text: "You told us income was %{income}." title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation." informative_text: "This is less than we would expect for someone in this working situation."
max: max:
page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?" title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
income2_value_check: income2_value_check:
page_header: ""
check_answer_label: "Buyer 2 income confirmation" check_answer_label: "Buyer 2 income confirmation"
hint_text: "" hint_text: ""
question_text: "Are you sure this is correct?" question_text: "Are you sure this is correct?"
min: min:
page_header: ""
title_text: "You told us income was %{income}." title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation." informative_text: "This is less than we would expect for someone in this working situation."
max: max:
page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?" title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
combined_income_value_check: combined_income_value_check:
page_header: "" page_header: ""
@ -64,3 +90,39 @@ en:
hint_text: "" hint_text: ""
question_text: "You told us that someone in the household uses a wheelchair." question_text: "You told us that someone in the household uses a wheelchair."
title_text: "You told us that someone in the household uses a wheelchair." title_text: "You told us that someone in the household uses a wheelchair."
buyer_livein_value_check:
buyer1:
page_header: ""
check_answer_label: "Buyer live in confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that buyer 1 will not live in the property."
informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
buyer2:
page_header: ""
check_answer_label: "Buyer live in confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that buyer 2 will not live in the property."
informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
student_not_child_value_check:
page_header: ""
check_answer_label: "Student not a child confirmation"
hint_text: ""
question_text: "Are you sure this person is not a child?"
title_text: "You told us this person is a student aged between 16 and 19."
informative_text: "Are you sure this person is not a child?"
partner_under_16_value_check:
page_header: ""
check_answer_label: "Partner under 16 confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"
multiple_partners_value_check:
page_header: ""
check_answer_label: "Multiple partners confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"

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

@ -0,0 +1,345 @@
en:
forms:
2024:
sales:
household_characteristics:
age1:
page_header: ""
age1_known:
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:
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:
buyer:
page_header: ""
age2_known:
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Do you know buyer 2’s age?"
age2:
check_answer_label: "Buyer 2’s age"
hint_text: ""
question_text: "Age"
person:
page_header: ""
age2_known:
check_answer_label: "Person 2’s age known?"
hint_text: ""
question_text: "Do you know person 2’s age?"
age2:
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: "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:
page_header: ""
age3_known:
check_answer_label: "Person 3’s age known?"
hint_text: ""
question_text: "Do you know person 3’s age?"
age3:
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: "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:
page_header: ""
age4_known:
check_answer_label: "Person 4’s age known?"
hint_text: ""
question_text: "Do you know person 4’s age?"
age4:
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: "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:
page_header: ""
age5_known:
check_answer_label: "Person 5’s age known?"
hint_text: ""
question_text: "Do you know person 5’s age?"
age5:
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: "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:
page_header: ""
age6_known:
check_answer_label: "Person 6’s age known?"
hint_text: ""
question_text: "Do you know person 6’s age?"
age6:
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: "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?"

66
config/locales/forms/2024/sales/soft_validations.en.yml

@ -3,25 +3,51 @@ en:
2024: 2024:
sales: sales:
soft_validations: soft_validations:
income1_value_check: retirement_value_check:
max:
page_header: ""
check_answer_label: "Retirement confirmation"
hint_text: ""
question_text: "Are you sure this person isn't retired?"
title_text: "You told us this person is over 66 and not retired."
informative_text: "The minimum expected retirement age in England is 66."
min:
page_header: ""
check_answer_label: "Retirement confirmation"
hint_text: ""
question_text: "Are you sure this person is retired?"
title_text: "You told us this person is aged %{age} years and retired."
informative_text: "The minimum expected retirement age in England is 66."
old_persons_shared_ownership_value_check:
page_header: "" page_header: ""
check_answer_label: "Shared ownership confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text:
joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme."
not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme."
informative_text: "At least one buyer must be aged 65 years and over to use this scheme."
income1_value_check:
check_answer_label: "Buyer 1 income confirmation" check_answer_label: "Buyer 1 income confirmation"
hint_text: "" hint_text: ""
question_text: "Are you sure this is correct?" question_text: "Are you sure this is correct?"
min: min:
page_header: ""
title_text: "You told us income was %{income}." title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation." informative_text: "This is less than we would expect for someone in this working situation."
max: max:
page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?" title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
income2_value_check: income2_value_check:
page_header: ""
check_answer_label: "Buyer 2 income confirmation" check_answer_label: "Buyer 2 income confirmation"
hint_text: "" hint_text: ""
question_text: "Are you sure this is correct?" question_text: "Are you sure this is correct?"
min: min:
page_header: ""
title_text: "You told us income was %{income}." title_text: "You told us income was %{income}."
informative_text: "This is less than we would expect for someone in this working situation." informative_text: "This is less than we would expect for someone in this working situation."
max: max:
page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?" title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
combined_income_value_check: combined_income_value_check:
page_header: "" page_header: ""
@ -64,3 +90,39 @@ en:
hint_text: "" hint_text: ""
question_text: "You told us that someone in the household uses a wheelchair." question_text: "You told us that someone in the household uses a wheelchair."
title_text: "You told us that someone in the household uses a wheelchair." title_text: "You told us that someone in the household uses a wheelchair."
buyer_livein_value_check:
buyer1:
page_header: ""
check_answer_label: "Buyer live in confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that buyer 1 will not live in the property."
informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
buyer2:
page_header: ""
check_answer_label: "Buyer live in confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that buyer 2 will not live in the property."
informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
student_not_child_value_check:
page_header: ""
check_answer_label: "Student not a child confirmation"
hint_text: ""
question_text: "Are you sure this person is not a child?"
title_text: "You told us this person is a student aged between 16 and 19."
informative_text: "Are you sure this person is not a child?"
partner_under_16_value_check:
page_header: ""
check_answer_label: "Partner under 16 confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"
multiple_partners_value_check:
page_header: ""
check_answer_label: "Multiple partners confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"

27
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_id) { "buyer_interview" }
let(:page_definition) { nil } 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:, id: "setup") }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)
@ -23,6 +24,29 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do
expect(page.description).to be_nil expect(page.description).to be_nil
end end
context "when form is before 2024" do
let(:subsection) { instance_double(Form::Subsection, form:, id: "household_characteristics") }
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.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 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 context "when there are joint buyers" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) }
@ -38,4 +62,5 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do
expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase") expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase")
end end
end end
end
end end

7
spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb

@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do
let(:page_id) { "buyer_1_live_in_value_check" } let(:page_id) { "buyer_1_live_in_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:person_index) { 1 } let(:person_index) { 1 }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)
@ -34,7 +35,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.buyer1_livein_wrong_for_ownership_type.title_text", "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer1.title_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
}) })
end end
@ -56,7 +57,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.buyer2_livein_wrong_for_ownership_type.title_text", "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer2.title_text",
"arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }],
}) })
end end

11
spec/models/form/sales/pages/multiple_partners_value_check_spec.rb

@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 } let(:person_index) { 1 }
let(:page_id) { "multiple_partners_value_check" } let(:page_id) { "multiple_partners_value_check" }
@ -39,13 +40,13 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.multiple_partners_sales.title", "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text",
"arguments" => [], "arguments" => [],
}) })
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -71,13 +72,13 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.multiple_partners_sales.title", "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text",
"arguments" => [], "arguments" => [],
}) })
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do

9
spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m
let(:page_id) { "old_persons_shared_ownership_value_check" } let(:page_id) { "old_persons_shared_ownership_value_check" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)
@ -34,13 +35,13 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.old_persons_shared_ownership.title_text.one", "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.not_joint_purchase",
"arguments" => [], "arguments" => [],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.old_persons_shared_ownership.hint_text" }) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.informative_text" })
end end
it "has the correct interruption_screen_question_ids" do it "has the correct interruption_screen_question_ids" do
@ -52,7 +53,7 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.old_persons_shared_ownership.title_text.two", "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.joint_purchase",
"arguments" => [], "arguments" => [],
}) })
end end

27
spec/models/form/sales/pages/partner_under16_value_check_spec.rb

@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 } let(:person_index) { 1 }
let(:page_id) { "partner_under_16_value_check" } let(:page_id) { "partner_under_16_value_check" }
@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age1", "key" => "age1",
@ -51,7 +52,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age2", "key" => "age2",
@ -89,7 +90,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age3", "key" => "age3",
@ -127,7 +128,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age4", "key" => "age4",
@ -165,7 +166,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age5", "key" => "age5",
@ -203,7 +204,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.partner_under_16_sales.title", "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age6", "key" => "age6",
@ -241,7 +242,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do

7
spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb

@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 2 } let(:person_index) { 2 }
let(:page_id) { "person_2_student_not_child_value_check" } let(:page_id) { "person_2_student_not_child_value_check" }
@ -23,12 +24,12 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.student_not_child.title_text", "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.title_text",
}) })
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.informative_text" })
end end
it "has correct questions" do it "has correct questions" do

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

@ -5,12 +5,11 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
let(:page_id) { "privacy_notice" } let(:page_id) { "privacy_notice" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection, id: "setup") }
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 before do
allow(subsection).to receive(:form).and_return(form) allow(subsection).to receive(:form).and_return(form)
allow(form).to receive(:start_year_after_2024?)
end end
it "has correct subsection" do it "has correct subsection" do
@ -32,9 +31,21 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
context "when there are joint buyers" do context "when there are joint buyers" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) }
context "when the form start year is before 2024" do
let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") }
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 it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
end end
end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "joint_purchase?" => true }]) expect(page.depends_on).to eq([{ "joint_purchase?" => true }])
@ -44,9 +55,21 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
context "when there is a single buyer" do context "when there is a single buyer" do
subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) }
context "when the form start year is before 2024" do
let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") }
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 it "has the expected copy_key" do
expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
end end
end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "not_joint_purchase?" => true }, { "jointpur" => nil }]) expect(page.depends_on).to eq([{ "not_joint_purchase?" => true }, { "jointpur" => nil }])

27
spec/models/form/sales/pages/retirement_value_check_spec.rb

@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 } let(:person_index) { 1 }
let(:page_id) { "person_1_retirement_value_check" } let(:page_id) { "person_1_retirement_value_check" }
@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age1", "key" => "age1",
@ -51,7 +52,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age2", "key" => "age2",
@ -89,7 +90,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age3", "key" => "age3",
@ -127,7 +128,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age4", "key" => "age4",
@ -165,7 +166,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age5", "key" => "age5",
@ -203,7 +204,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do
@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
it "has correct title_text" do it "has correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.min.title", "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "age6", "key" => "age6",
@ -241,7 +242,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
end end
it "has correct informative_text" do it "has correct informative_text" do
expect(page.informative_text).to eq({}) expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" })
end end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do

29
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_id) { nil }
let(:question_definition) { 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:, id: "setup")) }
it "has correct page" do it "has correct page" do
expect(question.page).to eq(page) expect(question.page).to eq(page)
@ -33,16 +34,42 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do
context "when there are joint buyers" do context "when there are joint buyers" do
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
context "when the form start year is before 2024" do
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) }
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 it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") expect(question.copy_key).to eq("sales.setup.noint.joint_purchase")
end end
end end
end
context "when there is a single buyer" do context "when there is a single buyer" do
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) }
context "when the form start year is before 2024" do
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) }
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 it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase")
end end
end end
end
end end

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

@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
let(:question_id) { nil } let(:question_id) { nil }
let(:question_definition) { nil } let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) } let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection, id: "setup") }
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)) }
before do before do
@ -31,23 +31,9 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
expect(question.derived?(nil)).to be false expect(question.derived?(nil)).to be false
end 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 context "when the form year is before 2024" do
let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") }
before do before do
allow(form).to receive(:start_year_after_2024?).and_return(false) allow(form).to receive(:start_year_after_2024?).and_return(false)
end end
@ -66,6 +52,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" 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.") expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyer before you can submit this log.")
end end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase")
end
end end
context "and there are joint buyers" do context "and there are joint buyers" do
@ -84,6 +74,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" 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.") expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyers before you can submit this log.")
end end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase")
end
end end
end end
@ -106,6 +100,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" 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.") 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 end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase")
end
end end
context "and there are joint buyers" do context "and there are joint buyers" do
@ -124,6 +122,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
it "returns correct unanswered_error_message" 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.") 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 end
it "has the expected copy_key" do
expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase")
end
end end
end end
end end

4
spec/services/bulk_upload/sales/year2023/row_parser_spec.rb

@ -1029,8 +1029,8 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
end end
it "populates with correct error message" do it "populates with correct error message" do
expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
end end
end end

4
spec/services/bulk_upload/sales/year2024/row_parser_spec.rb

@ -1486,8 +1486,8 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do
it "populates with correct error message" do it "populates with correct error message" do
parser.valid? parser.valid?
expect(parser.errors.where(:field_31, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") expect(parser.errors.where(:field_31, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
expect(parser.errors.where(:field_35, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") expect(parser.errors.where(:field_35, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.")
end end
end end
end end

Loading…
Cancel
Save