Browse Source

CLDC-3665 Extract sale information copy (#2711)

* Extract shared ownership copy

* Extract discounted ownership copy

* rename files

* CLDC-3665 Extract sale information soft validations (#2712)

* Extract shared ownership copy

* Extract shared ownership soft validations

* Extract discounted ownership validations

* Fix mappings

* Update some translations

* Remove full stops
pull/2745/head^2
kosiakkatrina 5 months ago committed by GitHub
parent
commit
51bc0cffeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/helpers/interruption_screen_helper.rb
  2. 2
      app/models/form/sales/pages/about_staircase.rb
  3. 1
      app/models/form/sales/pages/buyer_previous.rb
  4. 2
      app/models/form/sales/pages/deposit.rb
  5. 5
      app/models/form/sales/pages/deposit_and_mortgage_value_check.rb
  6. 2
      app/models/form/sales/pages/deposit_discount.rb
  7. 2
      app/models/form/sales/pages/deposit_value_check.rb
  8. 2
      app/models/form/sales/pages/discount.rb
  9. 5
      app/models/form/sales/pages/discounted_sale_value_check.rb
  10. 2
      app/models/form/sales/pages/equity.rb
  11. 1
      app/models/form/sales/pages/exchange_date.rb
  12. 2
      app/models/form/sales/pages/extra_borrowing.rb
  13. 5
      app/models/form/sales/pages/extra_borrowing_value_check.rb
  14. 2
      app/models/form/sales/pages/grant.rb
  15. 5
      app/models/form/sales/pages/grant_value_check.rb
  16. 1
      app/models/form/sales/pages/handover_date.rb
  17. 3
      app/models/form/sales/pages/handover_date_check.rb
  18. 1
      app/models/form/sales/pages/la_nominations.rb
  19. 1
      app/models/form/sales/pages/leasehold_charges.rb
  20. 3
      app/models/form/sales/pages/living_before_purchase.rb
  21. 1
      app/models/form/sales/pages/monthly_rent.rb
  22. 2
      app/models/form/sales/pages/mortgage_amount.rb
  23. 2
      app/models/form/sales/pages/mortgage_lender.rb
  24. 2
      app/models/form/sales/pages/mortgage_lender_other.rb
  25. 1
      app/models/form/sales/pages/mortgage_length.rb
  26. 2
      app/models/form/sales/pages/mortgageused.rb
  27. 2
      app/models/form/sales/pages/previous_bedrooms.rb
  28. 2
      app/models/form/sales/pages/previous_property_type.rb
  29. 1
      app/models/form/sales/pages/previous_tenure.rb
  30. 2
      app/models/form/sales/pages/purchase_price.rb
  31. 12
      app/models/form/sales/pages/purchase_price_outright_ownership.rb
  32. 1
      app/models/form/sales/pages/resale.rb
  33. 4
      app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
  34. 1
      app/models/form/sales/pages/staircase.rb
  35. 5
      app/models/form/sales/pages/staircase_bought_value_check.rb
  36. 7
      app/models/form/sales/pages/staircase_owned_value_check.rb
  37. 2
      app/models/form/sales/pages/value_shared_ownership.rb
  38. 3
      app/models/form/sales/questions/buyer_previous.rb
  39. 11
      app/models/form/sales/questions/deposit_amount.rb
  40. 3
      app/models/form/sales/questions/deposit_and_mortgage_value_check.rb
  41. 4
      app/models/form/sales/questions/deposit_discount.rb
  42. 6
      app/models/form/sales/questions/deposit_value_check.rb
  43. 6
      app/models/form/sales/questions/discount.rb
  44. 3
      app/models/form/sales/questions/discounted_sale_value_check.rb
  45. 4
      app/models/form/sales/questions/equity.rb
  46. 3
      app/models/form/sales/questions/exchange_date.rb
  47. 4
      app/models/form/sales/questions/extra_borrowing.rb
  48. 3
      app/models/form/sales/questions/extra_borrowing_value_check.rb
  49. 4
      app/models/form/sales/questions/fromprop.rb
  50. 4
      app/models/form/sales/questions/grant.rb
  51. 3
      app/models/form/sales/questions/grant_value_check.rb
  52. 4
      app/models/form/sales/questions/handover_date.rb
  53. 3
      app/models/form/sales/questions/handover_date_check.rb
  54. 4
      app/models/form/sales/questions/has_leasehold_charges.rb
  55. 4
      app/models/form/sales/questions/la_nominations.rb
  56. 3
      app/models/form/sales/questions/leasehold_charges.rb
  57. 4
      app/models/form/sales/questions/living_before_purchase.rb
  58. 22
      app/models/form/sales/questions/living_before_purchase_years.rb
  59. 4
      app/models/form/sales/questions/monthly_rent.rb
  60. 4
      app/models/form/sales/questions/mortgage_amount.rb
  61. 4
      app/models/form/sales/questions/mortgage_lender.rb
  62. 3
      app/models/form/sales/questions/mortgage_lender_other.rb
  63. 4
      app/models/form/sales/questions/mortgage_length.rb
  64. 3
      app/models/form/sales/questions/mortgageused.rb
  65. 4
      app/models/form/sales/questions/previous_bedrooms.rb
  66. 4
      app/models/form/sales/questions/previous_tenure.rb
  67. 14
      app/models/form/sales/questions/purchase_price.rb
  68. 4
      app/models/form/sales/questions/resale.rb
  69. 3
      app/models/form/sales/questions/shared_ownership_deposit_value_check.rb
  70. 4
      app/models/form/sales/questions/staircase.rb
  71. 3
      app/models/form/sales/questions/staircase_bought.rb
  72. 3
      app/models/form/sales/questions/staircase_bought_value_check.rb
  73. 3
      app/models/form/sales/questions/staircase_owned.rb
  74. 7
      app/models/form/sales/questions/staircase_owned_value_check.rb
  75. 3
      app/models/form/sales/questions/staircase_sale.rb
  76. 4
      app/models/form/sales/questions/value.rb
  77. 41
      config/locales/en.yml
  78. 208
      config/locales/forms/2023/sales/sale_information.en.yml
  79. 130
      config/locales/forms/2023/sales/soft_validations.en.yml
  80. 207
      config/locales/forms/2024/sales/sale_information.en.yml
  81. 133
      config/locales/forms/2024/sales/soft_validations.en.yml
  82. 2
      spec/models/form/lettings/subsections/tenancy_information_spec.rb
  83. 7
      spec/models/form/sales/pages/discounted_sale_value_check_spec.rb
  84. 5
      spec/models/form/sales/pages/handover_date_check_spec.rb
  85. 9
      spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
  86. 9
      spec/models/form/sales/pages/staircase_owned_value_check_spec.rb
  87. 2
      spec/models/form/sales/questions/deposit_value_check_spec.rb
  88. 2
      spec/models/form/sales/questions/living_before_purchase_years_spec.rb
  89. 2
      spec/models/form/sales/questions/staircase_owned_value_check_spec.rb

1
app/helpers/interruption_screen_helper.rb

@ -1,6 +1,7 @@
module InterruptionScreenHelper
def display_informative_text(informative_text, log)
return informative_text if informative_text.is_a? String
return "" if informative_text.nil?
return "" unless informative_text["arguments"]
translation_params = {}

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::AboutStaircase < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
@header = "About the staircasing transaction"
@copy_key = "sales.sale_information.about_staircasing"
@depends_on = [{
"staircase" => 1,
"joint_purchase?" => joint_purchase,

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
@copy_key = "sales.sale_information.soctenant.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@depends_on = [{ "joint_purchase?" => joint_purchase, "soctenant_is_inferred?" => false }]
end

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

@ -3,7 +3,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@optional = optional
@header = "About the deposit"
@copy_key = "sales.sale_information.deposit"
end
def questions

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

@ -6,8 +6,9 @@ class Form::Sales::Pages::DepositAndMortgageValueCheck < ::Form::Page
"mortgage_plus_deposit_less_than_discounted_value?" => true,
},
]
@copy_key = "sales.soft_validations.deposit_and_mortgage_value_check"
@title_text = {
"translation" => "soft_validations.deposit_and_mortgage.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "mortgage",
@ -27,7 +28,7 @@ class Form::Sales::Pages::DepositAndMortgageValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.deposit_and_mortgage.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page
def initialize(id, hsh, subsection, optional:)
super(id, hsh, subsection)
@optional = optional
@header = "About the deposit"
@copy_key = "sales.sale_information.cashdis"
end
def questions

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

@ -26,7 +26,7 @@ class Form::Sales::Pages::DepositValueCheck < ::Form::Page
def questions
@questions ||= [
Form::Sales::Questions::DepositValueCheck.new(nil, nil, self),
Form::Sales::Questions::DepositValueCheck.new(nil, nil, self, joint_purchase: @joint_purchase),
]
end

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::Discount < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "discount"
@header = "About the price of the property"
@copy_key = "sales.sale_information.discount"
@depends_on = [{
"right_to_buy?" => true,
}]

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

@ -2,8 +2,9 @@ class Form::Sales::Pages::DiscountedSaleValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index = nil)
super(id, hsh, subsection)
@depends_on = depends_on
@copy_key = "sales.soft_validations.discounted_sale_value_check"
@title_text = {
"translation" => "soft_validations.discounted_sale_value.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@ -13,7 +14,7 @@ class Form::Sales::Pages::DiscountedSaleValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.discounted_sale_value.informative_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::Equity < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "equity"
@header = "About the price of the property"
@copy_key = "sales.sale_information.equity"
end
def questions

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::ExchangeDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "exchange_contracts"
@copy_key = "sales.sale_information.exchange_date"
@depends_on = [{
"resale" => 2,
}]

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::ExtraBorrowing < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = ""
@copy_key = "sales.sale_information.extrabor"
@description = ""
@subsection = subsection
@depends_on = [{

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

@ -6,8 +6,9 @@ class Form::Sales::Pages::ExtraBorrowingValueCheck < Form::Page
"extra_borrowing_expected_but_not_reported?" => true,
},
]
@copy_key = "sales.soft_validations.extra_borrowing_value_check"
@title_text = {
"translation" => "soft_validations.extra_borrowing.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@ -17,7 +18,7 @@ class Form::Sales::Pages::ExtraBorrowingValueCheck < Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.extra_borrowing.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::Grant < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "grant"
@header = "About the price of the property"
@copy_key = "sales.sale_information.grant"
@depends_on = [{
"right_to_buy?" => false,
"rent_to_buy_full_ownership?" => false,

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

@ -2,13 +2,14 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "grant_value_check"
@copy_key = "sales.soft_validations.grant_value_check"
@depends_on = [
{
"grant_outside_common_range?" => true,
},
]
@title_text = {
"translation" => "soft_validations.grant.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@ -18,7 +19,7 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.grant.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::HandoverDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "handover_date"
@copy_key = "sales.sale_information.handover_date"
@depends_on = [
{ "ownershipsch" => 1, "resale" => 2 },
]

3
app/models/form/sales/pages/handover_date_check.rb

@ -2,11 +2,12 @@ class Form::Sales::Pages::HandoverDateCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "handover_date_check"
@copy_key = "sales.soft_validations.hodate_check"
@depends_on = [{ "saledate_check" => nil, "hodate_3_years_or_more_saledate?" => true },
{ "saledate_check" => 1, "hodate_3_years_or_more_saledate?" => true }]
@informative_text = {}
@title_text = {
"translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
end

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "la_nominations"
@copy_key = "sales.sale_information.la_nominations"
end
def questions

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::LeaseholdCharges < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@copy_key = "sales.sale_information.leaseholdcharges"
end
def questions

3
app/models/form/sales/pages/living_before_purchase.rb

@ -3,12 +3,13 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@joint_purchase = joint_purchase
@copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
def questions
@questions ||= [
living_before_purchase,
Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch),
Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch, joint_purchase: @joint_purchase),
].compact
end

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::MonthlyRent < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "monthly_rent"
@copy_key = "sales.sale_information.mrent"
end
def questions

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = "Mortgage Amount"
@copy_key = "sales.sale_information.mortgage"
@depends_on = [{ "mortgage_used?" => true }]
end

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageLender < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = ""
@copy_key = "sales.sale_information.mortgagelender"
@description = ""
@subsection = subsection
@depends_on = [{

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageLenderOther < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@header = ""
@copy_key = "sales.sale_information.mortgagelenderother"
@description = ""
@subsection = subsection
@depends_on = [{

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@copy_key = "sales.sale_information.mortlen"
@depends_on = [{
"mortgageused" => 1,
}]

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

@ -1,7 +1,7 @@
class Form::Sales::Pages::Mortgageused < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@header = "Mortgage Amount"
@copy_key = "sales.sale_information.mortgageused"
@ownershipsch = ownershipsch
end

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::PreviousBedrooms < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_bedrooms"
@header = "About the buyers’ previous property"
@copy_key = "sales.sale_information.frombeds"
@depends_on = [
{
"soctenant" => 1,

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::PreviousPropertyType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_property_type"
@header = ""
@copy_key = "sales.sale_information.fromprop"
@description = ""
@subsection = subsection
@depends_on = [

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::PreviousTenure < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "shared_ownership_previous_tenure"
@copy_key = "sales.sale_information.socprevten"
@header = ""
@description = ""
@subsection = subsection

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::PurchasePrice < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "purchase_price"
@header = "About the price of the property"
@copy_key = "sales.sale_information.purchase_price.discounted_ownership"
@depends_on = [{ "right_to_buy?" => true },
{
"right_to_buy?" => false,

12
app/models/form/sales/pages/purchase_price_outright_ownership.rb

@ -4,11 +4,21 @@ class Form::Sales::Pages::PurchasePriceOutrightOwnership < ::Form::Page
@depends_on = [
{ "outright_sale_or_discounted_with_full_ownership?" => true },
]
@header = "About the price of the property"
@top_guidance_partial = "financial_calculations_outright_sale"
@ownershipsch = ownershipsch
end
def copy_key
case @ownershipsch
when 1
"sales.sale_information.purchase_price.shared_ownership"
when 2
"sales.sale_information.purchase_price.discounted_ownership"
when 3
"sales.sale_information.purchase_price.outright_sale"
end
end
def questions
@questions ||= [
Form::Sales::Questions::PurchasePrice.new(nil, nil, self, ownershipsch: @ownershipsch),

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Resale < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "resale"
@copy_key = "sales.sale_information.resale"
@depends_on = [
{
"staircase" => 2,

4
app/models/form/sales/pages/shared_ownership_deposit_value_check.rb

@ -6,9 +6,9 @@ class Form::Sales::Pages::SharedOwnershipDepositValueCheck < ::Form::Page
"shared_ownership_deposit_invalid?" => true,
},
]
@informative_text = {}
@copy_key = "sales.soft_validations.shared_ownership_deposit_value_check"
@title_text = {
"translation" => "soft_validations.shared_ownership_deposit.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "mortgage_deposit_and_discount_error_fields",

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Staircase < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "staircasing"
@copy_key = "sales.sale_information.staircasing"
end
def questions

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

@ -7,8 +7,9 @@ class Form::Sales::Pages::StaircaseBoughtValueCheck < ::Form::Page
"staircase_bought_above_fifty?" => true,
},
]
@copy_key = "sales.soft_validations.staircase_bought_value_check"
@title_text = {
"translation" => "soft_validations.staircase_bought_seems_high.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "stairbought",
@ -17,7 +18,7 @@ class Form::Sales::Pages::StaircaseBoughtValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.staircase_bought_seems_high.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

7
app/models/form/sales/pages/staircase_owned_value_check.rb

@ -8,8 +8,9 @@ class Form::Sales::Pages::StaircaseOwnedValueCheck < ::Form::Page
"joint_purchase?" => joint_purchase,
},
]
@copy_key = "sales.soft_validations.stairowned_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@title_text = {
"translation" => joint_purchase ? "soft_validations.staircase_owned.title_text.two" : "soft_validations.staircase_owned.title_text.one",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "stairowned",
@ -19,14 +20,14 @@ class Form::Sales::Pages::StaircaseOwnedValueCheck < ::Form::Page
],
}
@informative_text = {
"translation" => "soft_validations.staircase_owned.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
def questions
@questions ||= [
Form::Sales::Questions::StaircaseOwnedValueCheck.new(nil, nil, self),
Form::Sales::Questions::StaircaseOwnedValueCheck.new(nil, nil, self, joint_purchase: @joint_purchase),
]
end

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

@ -2,7 +2,7 @@ class Form::Sales::Pages::ValueSharedOwnership < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "value_shared_ownership"
@header = "About the price of the property"
@copy_key = "sales.sale_information.value"
end
def questions

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "soctenant"
@check_answer_label = I18n.t("check_answer_labels.soctenant", count: joint_purchase ? 2 : 1)
@header = I18n.t("questions.soctenant", count: joint_purchase ? 2 : 1)
@copy_key = "sales.sale_information.soctenant.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

11
app/models/form/sales/questions/deposit_amount.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:, optional:)
super(id, hsh, subsection)
@id = "deposit"
@check_answer_label = "Cash deposit"
@header = "How much cash deposit was paid on the property?"
@copy_key = "sales.sale_information.deposit"
@type = "numeric"
@min = 0
@max = 999_999
@ -25,14 +24,6 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
2024 => { 1 => 96, 2 => 109, 3 => 116 },
}.freeze
def hint_text
if @optional
"Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue"
else
"Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan"
end
end
def top_guidance_partial
return "financial_calculations_shared_ownership" if @ownershipsch == 1
return "financial_calculations_discounted_ownership" if @ownershipsch == 2

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::DepositAndMortgageValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "deposit_and_mortgage_value_check"
@check_answer_label = "Deposit and mortgage against discount confirmation"
@header = "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)"
@copy_key = "sales.soft_validations.deposit_and_mortgage_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,15 +2,13 @@ class Form::Sales::Questions::DepositDiscount < ::Form::Question
def initialize(id, hsh, page)
super
@id = "cashdis"
@check_answer_label = "Cash discount through SocialHomeBuy"
@header = "How much cash discount was given through Social HomeBuy?"
@copy_key = "sales.sale_information.cashdis"
@type = "numeric"
@min = 0
@max = 999_999
@step = 1
@width = 5
@prefix = "£"
@hint_text = "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end

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

@ -1,8 +1,8 @@
class Form::Sales::Questions::DepositValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "deposit_value_check"
@copy_key = "sales.soft_validations.deposit_value_check"
@copy_key = "sales.soft_validations.deposit_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,17 +2,13 @@ class Form::Sales::Questions::Discount < ::Form::Question
def initialize(id, hsh, page)
super
@id = "discount"
@check_answer_label = "Percentage discount"
@header = "What was the percentage discount?"
@type = "numeric"
@copy_key = "sales.sale_information.discount"
@min = 0
@max = form.start_year_after_2024? ? 70 : 100
@step = 0.1
@width = 5
@suffix = "%"
@hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)</br></br>
If discount capped, enter capped %</br></br>
If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_discounted_ownership"
end

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

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

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

@ -2,15 +2,13 @@ class Form::Sales::Questions::Equity < ::Form::Question
def initialize(id, hsh, page)
super
@id = "equity"
@check_answer_label = "Initial percentage equity stake"
@header = "What was the initial percentage equity stake purchased?"
@copy_key = "sales.sale_information.equity"
@type = "numeric"
@min = 0
@max = 100
@step = 1
@width = 5
@suffix = "%"
@hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::ExchangeDate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "exdate"
@check_answer_label = "Exchange of contracts date"
@header = "What is the exchange of contracts date?"
@copy_key = "sales.sale_information.exchange_date"
@type = "date"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,12 +2,10 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "extrabor"
@check_answer_label = "Any other borrowing?"
@header = "Does this include any extra borrowing?"
@copy_key = "sales.sale_information.extrabor"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@page = page
@hint_text = ""
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::ExtraBorrowingValueCheck < ::Form::Question
def initialize(id, hsh, page)
super(id, hsh, page)
@id = "extrabor_value_check"
@check_answer_label = "Extra borrowing confirmation"
@copy_key = "sales.soft_validations.extra_borrowing_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
@ -18,6 +18,5 @@ class Form::Sales::Questions::ExtraBorrowingValueCheck < ::Form::Question
},
],
}
@header = "Are you sure there is no extra borrowing?"
end
end

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

@ -2,10 +2,8 @@ class Form::Sales::Questions::Fromprop < ::Form::Question
def initialize(id, hsh, page)
super
@id = "fromprop"
@check_answer_label = "Previous property type"
@header = "What was the previous property type?"
@copy_key = "sales.sale_information.fromprop"
@type = "radio"
@hint_text = ""
@page = page
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,15 +2,13 @@ class Form::Sales::Questions::Grant < ::Form::Question
def initialize(id, hsh, page)
super
@id = "grant"
@check_answer_label = "Amount of any loan, grant or subsidy"
@header = "What was the amount of any loan, grant, discount or subsidy given?"
@copy_key = "sales.sale_information.grant"
@type = "numeric"
@min = 0
@max = 999_999
@step = 1
@width = 5
@prefix = "£"
@hint_text = "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_discounted_ownership"
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::GrantValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "grant_value_check"
@check_answer_label = "Grant value confirmation"
@header = "Are you sure? Grants are usually £9,000 - £16,000"
@copy_key = "sales.soft_validations.grant_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,10 +2,8 @@ class Form::Sales::Questions::HandoverDate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "hodate"
@check_answer_label = "Practical completion or handover date"
@header = "What is the practical completion or handover date?"
@copy_key = "sales.sale_information.handover_date"
@type = "date"
@hint_text = "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::HandoverDateCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "hodate_check"
@check_answer_label = "Practical completion or handover date check"
@header = "Are you sure?"
@copy_key = "sales.soft_validations.hodate_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,9 +2,7 @@ class Form::Sales::Questions::HasLeaseholdCharges < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "has_mscharge"
@check_answer_label = "Does the property have any monthly leasehold charges?"
@header = "Does the property have any monthly leasehold charges?"
@hint_text = "For example, service and management charges"
@copy_key = "sales.sale_information.leaseholdcharges.has_mscharge"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@conditional_for = {

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::LaNominations < ::Form::Question
def initialize(id, hsh, page)
super
@id = "lanomagr"
@check_answer_label = "Household rehoused under a local authority nominations agreement?"
@header = "Was the household rehoused under a 'local authority nominations agreement'?"
@copy_key = "sales.sale_information.la_nominations"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mscharge"
@check_answer_label = "Monthly leasehold charges"
@header = "Enter the total monthly charge"
@copy_key = "sales.sale_information.leaseholdcharges.mscharge"
@type = "numeric"
@min = 1
@step = 0.01

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

@ -2,9 +2,7 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question
def initialize(id, hsh, page, ownershipsch:, joint_purchase:)
super(id, hsh, page)
@id = "proplen_asked"
@check_answer_label = "#{joint_purchase ? 'Buyers' : 'Buyer'} lived in the property before purchasing"
@header = "Did the #{joint_purchase ? 'buyers' : 'buyer'} live in the property before purchasing it?"
@hint_text = nil
@copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}.proplen_asked"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@conditional_for = {

22
app/models/form/sales/questions/living_before_purchase_years.rb

@ -1,10 +1,8 @@
class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question
def initialize(id, hsh, page, ownershipsch:)
def initialize(id, hsh, page, ownershipsch:, joint_purchase:)
super(id, hsh, page)
@id = "proplen"
@check_answer_label = "Number of years living in the property before purchase"
@header = header_text
@hint_text = hint_text
@copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}.proplen"
@type = "numeric"
@min = 0
@max = 80
@ -14,22 +12,6 @@ class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question
@question_number = question_number
end
def header_text
if form.start_date.year >= 2023
"How long did they live there?"
else
"How long did the buyer(s) live in the property before purchase?"
end
end
def hint_text
if form.start_date.year >= 2023
"You should round up to the nearest year"
else
"You should round this up to the nearest year. If the buyers haven't been living in the property, enter '0'"
end
end
def suffix_label(log)
" #{'year'.pluralize(log[id])}"
end

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

@ -2,14 +2,12 @@ class Form::Sales::Questions::MonthlyRent < ::Form::Question
def initialize(id, hsh, page)
super
@id = "mrent"
@check_answer_label = "Monthly rent"
@header = "What is the basic monthly rent?"
@copy_key = "sales.sale_information.mrent"
@type = "numeric"
@min = 0
@step = 0.01
@width = 5
@prefix = "£"
@hint_text = "Amount paid before any charges"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,14 +2,12 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgage"
@check_answer_label = "Mortgage amount"
@header = "What is the mortgage amount?"
@copy_key = "sales.sale_information.mortgage"
@type = "numeric"
@min = 1
@step = 1
@width = 5
@prefix = "£"
@hint_text = "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@top_guidance_partial = top_guidance_partial

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

@ -2,10 +2,8 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgagelender"
@check_answer_label = "Mortgage Lender"
@header = "What is the name of the mortgage lender?"
@copy_key = "sales.sale_information.mortgagelender"
@type = "select"
@hint_text = ""
@page = page
@bottom_guidance_partial = "mortgage_lender"
@ownershipsch = ownershipsch

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::MortgageLenderOther < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgagelenderother"
@check_answer_label = "Other Mortgage Lender"
@header = "What is the other mortgage lender?"
@copy_key = "sales.sale_information.mortgagelenderother"
@type = "text"
@page = page
@ownershipsch = ownershipsch

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

@ -2,14 +2,12 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortlen"
@check_answer_label = "Length of mortgage"
@header = "What is the length of the mortgage?"
@copy_key = "sales.sale_information.mortlen"
@type = "numeric"
@min = 0
@max = 60
@step = 1
@width = 5
@hint_text = "You should round up to the nearest year. Value should not exceed 60 years."
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgageused"
@check_answer_label = "Mortgage used"
@header = "Was a mortgage used for the purchase of this property?"
@copy_key = "sales.sale_information.mortgageused"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@ownershipsch = ownershipsch

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

@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousBedrooms < ::Form::Question
def initialize(id, hsh, page)
super
@id = "frombeds"
@check_answer_label = "Number of bedrooms in previous property"
@header = "How many bedrooms did the property have?"
@copy_key = "sales.sale_information.frombeds"
@type = "numeric"
@width = 5
@min = 1
@max = 6
@step = 1
@hint_text = "For bedsits enter 1"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,10 +2,8 @@ class Form::Sales::Questions::PreviousTenure < ::Form::Question
def initialize(id, hsh, page)
super
@id = "socprevten"
@check_answer_label = "Previous property tenure"
@header = "What was the previous tenure of the buyer?"
@copy_key = "sales.sale_information.socprevten"
@type = "radio"
@hint_text = ""
@page = page
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,14 +2,11 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question
def initialize(id, hsh, page, ownershipsch:)
super(id, hsh, page)
@id = "value"
@check_answer_label = "Purchase price"
@header = "What is the full purchase price?"
@type = "numeric"
@min = 0
@step = 0.01
@width = 5
@prefix = "£"
@hint_text = hint_text
@ownership_sch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@top_guidance_partial = top_guidance_partial
@ -20,10 +17,13 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question
2024 => { 2 => 101, 3 => 111 },
}.freeze
def hint_text
return if @ownership_sch == 3 # outright sale
"For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
def copy_key
case @ownership_sch
when 2
"sales.sale_information.purchase_price.discounted_ownership"
when 3
"sales.sale_information.purchase_price.outright_sale"
end
end
def top_guidance_partial

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Resale < ::Form::Question
def initialize(id, hsh, page)
super
@id = "resale"
@check_answer_label = "Is this a resale?"
@header = "Is this a resale?"
@copy_key = "sales.sale_information.resale"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

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

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::Staircase < ::Form::Question
def initialize(id, hsh, page)
super
@id = "staircase"
@check_answer_label = "Staircasing transaction"
@header = "Is this a staircasing transaction?"
@copy_key = "sales.sale_information.staircasing"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseBought < ::Form::Question
def initialize(id, hsh, page)
super
@id = "stairbought"
@check_answer_label = "Percentage bought in this staircasing transaction"
@header = "What percentage of the property has been bought in this staircasing transaction?"
@copy_key = "sales.sale_information.about_staircasing.stairbought"
@type = "numeric"
@width = 5
@min = 0

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

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

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseOwned < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "stairowned"
@check_answer_label = I18n.t("check_answer_labels.stairowned", count: joint_purchase ? 2 : 1)
@header = I18n.t("questions.stairowned", count: joint_purchase ? 2 : 1)
@copy_key = "sales.sale_information.about_staircasing.stairowned.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "numeric"
@width = 5
@min = 0

7
app/models/form/sales/questions/staircase_owned_value_check.rb

@ -1,9 +1,8 @@
class Form::Sales::Questions::StaircaseOwnedValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "stairowned_value_check"
@check_answer_label = "Percentage owned confirmation"
@header = "Are you sure?"
@copy_key = "sales.soft_validations.stairowned_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseSale < ::Form::Question
def initialize(id, hsh, page)
super
@id = "staircasesale"
@check_answer_label = "Part of a back-to-back staircasing transaction"
@header = "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?"
@copy_key = "sales.sale_information.about_staircasing.staircasesale"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,14 +2,12 @@ class Form::Sales::Questions::Value < ::Form::Question
def initialize(id, hsh, page)
super
@id = "value"
@check_answer_label = "Full purchase price"
@header = "What was the full purchase price?"
@copy_key = "sales.sale_information.value"
@type = "numeric"
@min = 0
@step = 1
@width = 5
@prefix = "£"
@hint_text = "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end

41
config/locales/en.yml

@ -605,12 +605,6 @@ en:
outside_range_title: "You told us the rent is %{brent}."
informative_text: "This is %{higher_or_lower} than we would expect."
hint_text: "Check the following:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the rent type is correct, for example affordable or social rent</li></ul>"
staircase_owned:
title_text:
one: "You told us that the buyer now owns %{stairowned} of the property."
two: "You told us that the buyers now own %{stairowned} of the property."
hint_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme.
Make sure these answers are correct."
retirement:
min:
title: "You told us this person is aged %{age} years and retired."
@ -618,9 +612,6 @@ Make sure these answers are correct."
max:
title: "You told us this person is over 66 and not retired."
hint_text: "The minimum expected retirement age in England is 66."
extra_borrowing:
title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}."
hint_text: "This is higher than the purchase price minus the discount."
pregnancy:
title: "You told us somebody in the household is pregnant."
all_male_tenants: "You also told us that all the tenants living at the property are male."
@ -631,19 +622,6 @@ Make sure these answers are correct."
void_date:
title_text: "You told us that the property has been vacant for more than 2 years."
hint_text: "This is higher than we would expect."
shared_ownership_deposit:
title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
staircase_bought_seems_high:
title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
hint_text: "Most staircasing transactions are less than 50%"
discounted_sale_value:
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}."
care_home_charges:
title_text: "Care home charges should be provided if this is a care home accommodation."
grant:
title_text: "You told us that the grant amount is %{grant}."
hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
referral:
title_text: "Are you sure?"
hint_text: "This is a general needs log, and this referral type is for supported housing."
@ -656,16 +634,11 @@ Make sure these answers are correct."
charges:
informative_text: "This is higher than we would expect."
hint_text: "Check the following:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the needs type</li></ul>"
deposit_and_mortgage:
title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}."
hint_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount."
reasonother:
title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}."
informative_text: "The reason you have entered looks very similar to one of the existing response categories.
Please check the categories and select the appropriate one.
If the existing categories are not suitable, please confirm here to move onto the next question."
hodate:
must_be_less_than_3_years_from_saledate: "You told us practical completion or handover date is more than 3 years before sale completion date."
saledate:
must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date."
partner_under_16_lettings:
@ -703,12 +676,6 @@ Make sure these answers are correct."
W: "Suitable for someone who uses a wheelchair and offers the full use of all rooms and facilities."
A: "Fitted with stairlifts, ramps, level access showers or grab rails."
N: "Not designed to wheelchair-user standards or fitted with any equipment or adaptations."
soctenant:
one: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?"
other: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?"
stairowned:
one: "What percentage of the property does the buyer now own in total?"
other: "What percentage of the property do the buyers now own in total?"
hints:
location:
@ -722,14 +689,6 @@ Make sure these answers are correct."
bulk_upload:
needstype: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes."
check_answer_labels:
soctenant:
one: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?"
other: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?"
stairowned:
one: "Percentage the buyer now owns in total."
other: "Percentage the buyers now own in total."
warnings:
organisation:
deactivate: "All schemes and users at this organisation will be deactivated. All the organisation's relationships will be removed. It will no longer be possible to create logs for this organisation."

208
config/locales/forms/2023/sales/sale_information.en.yml

@ -0,0 +1,208 @@
en:
forms:
2023:
sales:
sale_information:
living_before_purchase:
joint_purchase:
page_header: ""
proplen:
check_answer_label: "Number of years living in the property before purchase"
hint_text: "You should round up to the nearest year"
question_text: "How long did they live there?"
proplen_asked:
check_answer_label: "Buyers lived in the property before purchasing"
hint_text: ""
question_text: "Did the buyers live in the property before purchasing it?"
not_joint_purchase:
page_header: ""
proplen:
check_answer_label: "Number of years living in the property before purchase"
hint_text: "You should round up to the nearest year"
question_text: "How long did they live there?"
proplen_asked:
check_answer_label: "Buyer lived in the property before purchasing"
hint_text: ""
question_text: "Did the buyer live in the property before purchasing it?"
staircasing:
page_header: ""
check_answer_label: "Staircasing transaction"
hint_text: "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
question_text: "Is this a staircasing transaction?"
about_staircasing:
page_header: "About the staircasing transaction"
stairbought:
check_answer_label: "Percentage bought in this staircasing transaction"
hint_text: ""
question_text: "What percentage of the property has been bought in this staircasing transaction?"
stairowned:
joint_purchase:
check_answer_label: "Percentage the buyers now own in total"
hint_text: ""
question_text: "What percentage of the property do the buyers now own in total?"
not_joint_purchase:
check_answer_label: "Percentage the buyer now owns in total"
hint_text: ""
question_text: "What percentage of the property does the buyer now own in total?"
resale:
page_header: ""
check_answer_label: "Is this a resale?"
hint_text: "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
question_text: "Is this a resale?"
exchange_date:
page_header: ""
check_answer_label: "Exchange of contracts date"
hint_text: ""
question_text: "What is the exchange of contracts date?"
handover_date:
page_header: ""
check_answer_label: "Practical completion or handover date"
hint_text: "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
question_text: "What is the practical completion or handover date?"
la_nominations:
page_header: ""
check_answer_label: "Household rehoused under a local authority nominations agreement?"
hint_text: "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
question_text: "Was the household rehoused under a 'local authority nominations agreement'?"
soctenant:
joint_purchase:
page_header: ""
check_answer_label: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?"
hint_text: ""
question_text: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?"
not_joint_purchase:
page_header: ""
check_answer_label: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?"
hint_text: ""
question_text: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?"
frombeds:
page_header: "About the buyers’ previous property"
check_answer_label: "Number of bedrooms in previous property"
hint_text: "For bedsits enter 1"
question_text: "How many bedrooms did the property have?"
fromprop:
page_header: ""
check_answer_label: "Previous property type"
hint_text: ""
question_text: "What was the previous property type?"
socprevten:
page_header: ""
check_answer_label: "Previous property tenure"
hint_text: ""
question_text: "What was the previous tenure of the buyer?"
value:
page_header: "About the price of the property"
check_answer_label: "Full purchase price"
hint_text: "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)"
question_text: "What was the full purchase price?"
equity:
page_header: "About the price of the property"
check_answer_label: "Initial percentage equity stake"
hint_text: "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
question_text: "What was the initial percentage equity stake purchased?"
mortgageused:
page_header: "Mortgage Amount"
check_answer_label: "Mortgage used"
hint_text: ""
question_text: "Was a mortgage used for the purchase of this property?"
mortgage:
page_header: "Mortgage Amount"
check_answer_label: "Mortgage amount"
hint_text: "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
question_text: "What is the mortgage amount?"
mortgagelender:
page_header: ""
check_answer_label: "Mortgage lender"
hint_text: ""
question_text: "What is the name of the mortgage lender?"
mortgagelenderother:
page_header: ""
check_answer_label: "Other Mortgage Lender"
hint_text: ""
question_text: "What is the other mortgage lender?"
mortlen:
page_header: ""
check_answer_label: "Length of mortgage"
hint_text: "You should round up to the nearest year. Value should not exceed 60 years."
question_text: "What is the length of the mortgage?"
extrabor:
page_header: ""
check_answer_label: "Any other borrowing?"
hint_text: ""
question_text: "Does this include any extra borrowing?"
deposit:
page_header: "About the deposit"
check_answer_label: "Deposit amount"
hint_text: "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan"
question_text: "How much cash deposit was paid on the property?"
cashdis:
page_header: "About the deposit"
check_answer_label: "Cash discount through SocialHomeBuy"
hint_text: "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
question_text: "How much cash discount was given through Social HomeBuy?"
mrent:
page_header: ""
check_answer_label: "Monthly rent"
hint_text: "Amount paid before any charges"
question_text: "What is the basic monthly rent?"
leaseholdcharges:
page_header: ""
has_mscharge:
check_answer_label: "Does the property have any monthly leasehold charges?"
hint_text: "For example, service and management charges"
question_text: "Does the property have any monthly leasehold charges?"
mscharge:
check_answer_label: "Monthly leasehold charges"
hint_text: ""
question_text: "Enter the total monthly charge"
purchase_price:
shared_ownership:
page_header: "About the price of the property"
check_answer_label: "Purchase price"
hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
question_text: "What is the full purchase price?"
discounted_ownership:
page_header: "About the price of the property"
check_answer_label: "Purchase price"
hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
question_text: "What is the full purchase price?"
outright_sale:
page_header: "About the price of the property"
check_answer_label: "Purchase price"
hint_text: ""
question_text: "What is the full purchase price?"
discount:
page_header: "About the price of the property"
check_answer_label: "Percentage discount"
hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)</br></br>If discount capped, enter capped %</br></br>If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
question_text: "What was the percentage discount?"
grant:
page_header: "About the price of the property"
check_answer_label: "Amount of any loan, grant or subsidy"
hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
question_text: "What was the amount of any loan, grant, discount or subsidy given?"

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

@ -40,7 +40,7 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
income2_value_check:
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
@ -60,14 +60,6 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
value_value_check:
page_header: ""
check_answer_label: "Purchase price confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us the purchase price is %{value}."
informative_text: "This is %{higher_or_lower} than we would expect."
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
@ -76,22 +68,6 @@ en:
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
monthly_charges_value_check:
page_header: ""
check_answer_label: "Monthly charges confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the monthly charges were %{mscharge}."
informative_text: "This is higher than we would expect."
percentage_discount_value_check:
page_header: ""
check_answer_label: "Percentage discount confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the percentage discount is %{discount}."
informative_text: "This is higher than we would expect."
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
@ -104,15 +80,65 @@ en:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
deposit_value_check:
staircase_bought_value_check:
page_header: ""
check_answer_label: "Deposit confirmation"
check_answer_label: "Percentage bought confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
question_text: "Are you sure this is correct?"
title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
informative_text: "Most staircasing transactions are less than 50%"
stairowned_value_check:
joint_purchase:
page_header: ""
check_answer_label: "Percentage owned confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us that the buyers now own %{stairowned} of the property."
informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
not_joint_purchase:
page_header: ""
check_answer_label: "Percentage owned confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us that the buyer now owns %{stairowned} of the property."
informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
hodate_check:
page_header: ""
check_answer_label: "Practical completion or handover date check"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us practical completion or handover date is more than 3 years before sale completion date."
value_value_check:
page_header: ""
check_answer_label: "Purchase price confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us the purchase price is %{value}."
informative_text: "This is %{higher_or_lower} than we would expect."
shared_ownership_deposit_value_check:
page_header: ""
check_answer_label: "Shared ownership deposit confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
deposit_value_check:
joint_purchase:
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
not_joint_purchase:
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
@ -162,3 +188,51 @@ en:
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?"
monthly_charges_value_check:
page_header: ""
check_answer_label: "Monthly charges confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the monthly charges were %{mscharge}."
informative_text: "This is higher than we would expect."
extra_borrowing_value_check:
page_header: ""
check_answer_label: "Extra borrowing confirmation"
hint_text: ""
question_text: "Are you sure there is no extra borrowing?"
title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}."
informative_text: "This is higher than the purchase price minus the discount."
percentage_discount_value_check:
page_header: ""
check_answer_label: "Percentage discount confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the percentage discount is %{discount}."
informative_text: "This is higher than we would expect."
grant_value_check:
page_header: ""
check_answer_label: "Grant value confirmation"
hint_text: ""
question_text: "Are you sure? Grants are usually £9,000 - £16,000"
title_text: "You told us that the grant amount is %{grant}."
informative_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
discounted_sale_value_check:
page_header: ""
check_answer_label: "Discounted sale value confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
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}."
deposit_and_mortgage_value_check:
page_header: ""
check_answer_label: "Deposit and mortgage against discount confirmation"
hint_text: ""
question_text: "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)"
title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}."
informative_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount."

207
config/locales/forms/2024/sales/sale_information.en.yml

@ -0,0 +1,207 @@
en:
forms:
2024:
sales:
sale_information:
living_before_purchase:
joint_purchase:
page_header: ""
proplen:
check_answer_label: "Number of years living in the property before purchase"
hint_text: "You should round up to the nearest year"
question_text: "How long did they live there?"
proplen_asked:
check_answer_label: "Buyers lived in the property before purchasing"
hint_text: ""
question_text: "Did the buyers live in the property before purchasing it?"
not_joint_purchase:
page_header: ""
proplen:
check_answer_label: "Number of years living in the property before purchase"
hint_text: "You should round up to the nearest year"
question_text: "How long did they live there?"
proplen_asked:
check_answer_label: "Buyer lived in the property before purchasing"
hint_text: ""
question_text: "Did the buyer live in the property before purchasing it?"
staircasing:
page_header: ""
check_answer_label: "Staircasing transaction"
hint_text: "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
question_text: "Is this a staircasing transaction?"
about_staircasing:
page_header: "About the staircasing transaction"
stairbought:
check_answer_label: "Percentage bought in this staircasing transaction"
hint_text: ""
question_text: "What percentage of the property has been bought in this staircasing transaction?"
stairowned:
joint_purchase:
check_answer_label: "Percentage the buyers now own in total"
hint_text: ""
question_text: "What percentage of the property do the buyers now own in total?"
not_joint_purchase:
check_answer_label: "Percentage the buyer now owns in total"
hint_text: ""
question_text: "What percentage of the property does the buyer now own in total?"
staircasesale:
check_answer_label: "Part of a back-to-back staircasing transaction"
hint_text: ""
question_text: "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?"
resale:
page_header: ""
check_answer_label: "Is this a resale?"
hint_text: "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
question_text: "Is this a resale?"
exchange_date:
page_header: ""
check_answer_label: "Exchange of contracts date"
hint_text: ""
question_text: "What is the exchange of contracts date?"
handover_date:
page_header: ""
check_answer_label: "Practical completion or handover date"
hint_text: "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
question_text: "What is the practical completion or handover date?"
la_nominations:
page_header: ""
check_answer_label: "Household rehoused under a local authority nominations agreement?"
hint_text: "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
question_text: "Was the household rehoused under a 'local authority nominations agreement'?"
soctenant:
joint_purchase:
page_header: ""
check_answer_label: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?"
hint_text: ""
question_text: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?"
not_joint_purchase:
page_header: ""
check_answer_label: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?"
hint_text: ""
question_text: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?"
frombeds:
page_header: "About the buyers’ previous property"
check_answer_label: "Number of bedrooms in previous property"
hint_text: "For bedsits enter 1"
question_text: "How many bedrooms did the property have?"
fromprop:
page_header: ""
check_answer_label: "Previous property type"
hint_text: ""
question_text: "What was the previous property type?"
socprevten:
page_header: ""
check_answer_label: "Previous property tenure"
hint_text: ""
question_text: "What was the previous tenure of the buyer?"
value:
page_header: "About the price of the property"
check_answer_label: "Full purchase price"
hint_text: "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)"
question_text: "What was the full purchase price?"
equity:
page_header: "About the price of the property"
check_answer_label: "Initial percentage equity stake"
hint_text: "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
question_text: "What was the initial percentage equity stake purchased?"
mortgageused:
page_header: "Mortgage Amount"
check_answer_label: "Mortgage used"
hint_text: ""
question_text: "Was a mortgage used for the purchase of this property?"
mortgage:
page_header: "Mortgage Amount"
check_answer_label: "Mortgage amount"
hint_text: "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
question_text: "What is the mortgage amount?"
mortgagelender:
page_header: ""
check_answer_label: "Mortgage lender"
hint_text: ""
question_text: "What is the name of the mortgage lender?"
mortgagelenderother:
page_header: ""
check_answer_label: "Other Mortgage Lender"
hint_text: ""
question_text: "What is the other mortgage lender?"
mortlen:
page_header: ""
check_answer_label: "Length of mortgage"
hint_text: "You should round up to the nearest year. Value should not exceed 60 years."
question_text: "What is the length of the mortgage?"
extrabor:
page_header: ""
check_answer_label: "Any other borrowing?"
hint_text: ""
question_text: "Does this include any extra borrowing?"
deposit:
page_header: "About the deposit"
check_answer_label: "Deposit amount"
hint_text: "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue"
question_text: "How much cash deposit was paid on the property?"
cashdis:
page_header: "About the deposit"
check_answer_label: "Cash discount through SocialHomeBuy"
hint_text: "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
question_text: "How much cash discount was given through Social HomeBuy?"
mrent:
page_header: ""
check_answer_label: "Monthly rent"
hint_text: "Amount paid before any charges"
question_text: "What is the basic monthly rent?"
leaseholdcharges:
page_header: ""
has_mscharge:
check_answer_label: "Does the property have any monthly leasehold charges?"
hint_text: "For example, service and management charges"
question_text: "Does the property have any monthly leasehold charges?"
mscharge:
check_answer_label: "Monthly leasehold charges"
hint_text: ""
question_text: "Enter the total monthly charge"
purchase_price:
discounted_ownership:
page_header: "About the price of the property"
check_answer_label: "Purchase price"
hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
question_text: "What is the full purchase price?"
outright_sale:
page_header: "About the price of the property"
check_answer_label: "Purchase price"
hint_text: ""
question_text: "What is the full purchase price?"
discount:
page_header: "About the price of the property"
check_answer_label: "Percentage discount"
hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)</br></br>If discount capped, enter capped %</br></br>If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
question_text: "What was the percentage discount?"
grant:
page_header: "About the price of the property"
check_answer_label: "Amount of any loan, grant or subsidy"
hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
question_text: "What was the amount of any loan, grant, discount or subsidy given?"

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

@ -57,15 +57,6 @@ en:
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
informative_text: ""
value_value_check:
page_header: ""
check_answer_label: "Purchase price confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us the purchase price is %{value}."
informative_text: "This is %{higher_or_lower} than we would expect."
mortgage_value_check:
page_header: ""
@ -75,22 +66,6 @@ en:
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
monthly_charges_value_check:
page_header: ""
check_answer_label: "Monthly charges confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the monthly charges were %{mscharge}."
informative_text: "This is higher than we would expect."
percentage_discount_value_check:
page_header: ""
check_answer_label: "Percentage discount confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the percentage discount is %{discount}."
informative_text: "This is higher than we would expect."
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
@ -103,15 +78,65 @@ en:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
deposit_value_check:
staircase_bought_value_check:
page_header: ""
check_answer_label: "Deposit confirmation"
check_answer_label: "Percentage bought confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
question_text: "Are you sure this is correct?"
title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
informative_text: "Most staircasing transactions are less than 50%"
stairowned_value_check:
joint_purchase:
page_header: ""
check_answer_label: "Percentage owned confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us that the buyers now own %{stairowned} of the property."
informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
not_joint_purchase:
page_header: ""
check_answer_label: "Percentage owned confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us that the buyer now owns %{stairowned} of the property."
informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
hodate_check:
page_header: ""
check_answer_label: "Practical completion or handover date check"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us practical completion or handover date is more than 3 years before sale completion date."
value_value_check:
page_header: ""
check_answer_label: "Purchase price confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "You told us the purchase price is %{value}."
informative_text: "This is %{higher_or_lower} than we would expect."
shared_ownership_deposit_value_check:
page_header: ""
check_answer_label: "Shared ownership deposit confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
deposit_value_check:
joint_purchase:
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
not_joint_purchase:
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
@ -129,6 +154,7 @@ en:
hint_text: ""
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."
buyer_livein_value_check:
buyer1:
page_header: ""
@ -144,6 +170,7 @@ en:
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"
@ -151,6 +178,7 @@ en:
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"
@ -158,6 +186,7 @@ en:
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"
@ -165,3 +194,51 @@ en:
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?"
monthly_charges_value_check:
page_header: ""
check_answer_label: "Monthly charges confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the monthly charges were %{mscharge}."
informative_text: "This is higher than we would expect."
extra_borrowing_value_check:
page_header: ""
check_answer_label: "Extra borrowing confirmation"
hint_text: ""
question_text: "Are you sure there is no extra borrowing?"
title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}."
informative_text: "This is higher than the purchase price minus the discount."
percentage_discount_value_check:
page_header: ""
check_answer_label: "Percentage discount confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us that the percentage discount is %{discount}."
informative_text: "This is higher than we would expect."
grant_value_check:
page_header: ""
check_answer_label: "Grant value confirmation"
hint_text: ""
question_text: "Are you sure? Grants are usually £9,000 - £16,000"
title_text: "You told us that the grant amount is %{grant}."
informative_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
discounted_sale_value_check:
page_header: ""
check_answer_label: "Discounted sale value confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
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}."
deposit_and_mortgage_value_check:
page_header: ""
check_answer_label: "Deposit and mortgage against discount confirmation"
hint_text: ""
question_text: "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)"
title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}."
informative_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount."

2
spec/models/form/lettings/subsections/tenancy_information_spec.rb

@ -12,7 +12,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do
end
describe "pages" do
let(:section) { instance_double(Form::Sales::Sections::Household, form:) }
let(:section) { instance_double(Form::Lettings::Sections::TenancyAndProperty, form:) }
let(:form) { instance_double(Form, start_date:) }
before do

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

@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::DiscountedSaleValueCheck, type: :model do
let(:page_id) { "discounted_sale_value_check" }
let(:page_definition) { nil }
let(: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
expect(page.subsection).to eq(subsection)
@ -22,14 +23,14 @@ RSpec.describe Form::Sales::Pages::DiscountedSaleValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.discounted_sale_value.title_text",
"translation" => "forms.2024.sales.soft_validations.discounted_sale_value_check.title_text",
"arguments" => [{ "arguments_for_key" => "value_with_discount", "i18n_template" => "value_with_discount", "key" => "field_formatted_as_currency" }],
})
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({
"translation" => "soft_validations.discounted_sale_value.informative_text",
"translation" => "forms.2024.sales.soft_validations.discounted_sale_value_check.informative_text",
"arguments" => [{ "arguments_for_key" => "mortgage_deposit_and_grant_total", "i18n_template" => "mortgage_deposit_and_grant_total", "key" => "field_formatted_as_currency" }],
})
end

5
spec/models/form/sales/pages/handover_date_check_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do
let(:page_id) { "" }
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
expect(page.subsection).to eq(subsection)
@ -21,7 +22,7 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate",
"translation" => "forms.2024.sales.soft_validations.hodate_check.title_text",
"arguments" => [],
})
end

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

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
let(:page_id) { "shared_ownership_deposit_value_check" }
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
expect(page.subsection).to eq(subsection)
@ -29,7 +30,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.shared_ownership_deposit.title_text",
"translation" => "forms.2024.sales.soft_validations.shared_ownership_deposit_value_check.title_text",
"arguments" => [
{ "i18n_template" => "mortgage_deposit_and_discount_error_fields", "key" => "mortgage_deposit_and_discount_error_fields" },
{ "arguments_for_key" => "mortgage_deposit_and_discount_total", "i18n_template" => "mortgage_deposit_and_discount_total", "key" => "field_formatted_as_currency" },
@ -37,10 +38,6 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
})
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({})
end
it "has the correct interruption_screen_question_ids" do
expect(page.interruption_screen_question_ids).to eq(%w[mortgage mortgageused cashdis type deposit value equity])
end

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

@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
let(:page_id) { "an_id" }
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(:joint_purchase) { false }
it "has correct subsection" do
@ -33,7 +34,7 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
it "has the correct informative_text" do
expect(page.informative_text).to eq({
"translation" => "soft_validations.staircase_owned.hint_text",
"translation" => "forms.2024.sales.soft_validations.stairowned_value_check.not_joint_purchase.informative_text",
"arguments" => [],
})
end
@ -45,7 +46,7 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
context "when not a joint purchase" do
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.staircase_owned.title_text.one",
"translation" => "forms.2024.sales.soft_validations.stairowned_value_check.not_joint_purchase.title_text",
"arguments" => [
{
"key" => "stairowned",
@ -62,7 +63,7 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.staircase_owned.title_text.two",
"translation" => "forms.2024.sales.soft_validations.stairowned_value_check.joint_purchase.title_text",
"arguments" => [
{
"key" => "stairowned",

2
spec/models/form/sales/questions/deposit_value_check_spec.rb

@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page) }
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
let(:question_id) { nil }
let(:question_definition) { nil }

2
spec/models/form/sales/questions/living_before_purchase_years_spec.rb

@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) }
subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1, joint_purchase: true) }
let(:question_id) { nil }
let(:question_definition) { nil }

2
spec/models/form/sales/questions/staircase_owned_value_check_spec.rb

@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::StaircaseOwnedValueCheck, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page) }
subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
let(:question_id) { nil }
let(:question_definition) { nil }

Loading…
Cancel
Save