From 48032fa44b20a8aa0ad2072772e0f625d33e7c05 Mon Sep 17 00:00:00 2001
From: Kat <54268893+kosiakkatrina@users.noreply.github.com>
Date: Mon, 21 Oct 2024 08:32:50 +0100
Subject: [PATCH] Extract shared ownership soft validations
---
.../sales/pages/about_price_value_check.rb | 5 +-
.../form/sales/pages/deposit_value_check.rb | 2 +-
.../form/sales/pages/handover_date_check.rb | 3 +-
.../pages/monthly_charges_value_check.rb | 5 +-
.../shared_ownership_deposit_value_check.rb | 4 +-
.../pages/staircase_bought_value_check.rb | 5 +-
.../pages/staircase_owned_value_check.rb | 7 +-
.../questions/about_price_value_check.rb | 3 +-
.../sales/questions/deposit_value_check.rb | 6 +-
.../sales/questions/handover_date_check.rb | 3 +-
.../questions/monthly_charges_value_check.rb | 3 +-
.../shared_ownership_deposit_value_check.rb | 3 +-
.../questions/staircase_bought_value_check.rb | 3 +-
.../questions/staircase_owned_value_check.rb | 7 +-
config/locales/en.yml | 19 -----
.../forms/2023/sales/soft_validations.en.yml | 76 ++++++++++++++++++-
.../forms/2024/sales/soft_validations.en.yml | 75 +++++++++++++++++-
.../subsections/tenancy_information_spec.rb | 2 +-
.../pages/about_price_value_check_spec.rb | 7 +-
.../sales/pages/handover_date_check_spec.rb | 5 +-
.../pages/monthly_charges_value_check_spec.rb | 7 +-
...ared_ownership_deposit_value_check_spec.rb | 9 +--
.../pages/staircase_owned_value_check_spec.rb | 9 ++-
.../questions/deposit_value_check_spec.rb | 2 +-
.../staircase_owned_value_check_spec.rb | 2 +-
25 files changed, 196 insertions(+), 76 deletions(-)
diff --git a/app/models/form/sales/pages/about_price_value_check.rb b/app/models/form/sales/pages/about_price_value_check.rb
index 8b5cb45ab..41ae283dc 100644
--- a/app/models/form/sales/pages/about_price_value_check.rb
+++ b/app/models/form/sales/pages/about_price_value_check.rb
@@ -6,8 +6,9 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page
"purchase_price_out_of_soft_range?" => true,
},
]
+ @copy_key = "sales.soft_validations.value_value_check"
@title_text = {
- "translation" => "soft_validations.purchase_price.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "value",
@@ -17,7 +18,7 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.purchase_price.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
diff --git a/app/models/form/sales/pages/deposit_value_check.rb b/app/models/form/sales/pages/deposit_value_check.rb
index cbec4b031..fea99b28b 100644
--- a/app/models/form/sales/pages/deposit_value_check.rb
+++ b/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
diff --git a/app/models/form/sales/pages/handover_date_check.rb b/app/models/form/sales/pages/handover_date_check.rb
index e8d666f60..690c3dde7 100644
--- a/app/models/form/sales/pages/handover_date_check.rb
+++ b/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
diff --git a/app/models/form/sales/pages/monthly_charges_value_check.rb b/app/models/form/sales/pages/monthly_charges_value_check.rb
index 662a048bb..f6aef088c 100644
--- a/app/models/form/sales/pages/monthly_charges_value_check.rb
+++ b/app/models/form/sales/pages/monthly_charges_value_check.rb
@@ -6,8 +6,9 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page
"monthly_charges_over_soft_max?" => true,
},
]
+ @copy_key = "sales.soft_validations.monthly_charges_value_check"
@title_text = {
- "translation" => "soft_validations.monthly_charges_over_soft_max.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::MonthlyChargesValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.monthly_charges_over_soft_max.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
index bc8df6743..e56db3e38 100644
--- a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
+++ b/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",
diff --git a/app/models/form/sales/pages/staircase_bought_value_check.rb b/app/models/form/sales/pages/staircase_bought_value_check.rb
index 283261a53..3b505f3cc 100644
--- a/app/models/form/sales/pages/staircase_bought_value_check.rb
+++ b/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
diff --git a/app/models/form/sales/pages/staircase_owned_value_check.rb b/app/models/form/sales/pages/staircase_owned_value_check.rb
index d83bf7d5d..1a26215e3 100644
--- a/app/models/form/sales/pages/staircase_owned_value_check.rb
+++ b/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
diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb
index 2b51cd7fb..52f7b156f 100644
--- a/app/models/form/sales/questions/about_price_value_check.rb
+++ b/app/models/form/sales/questions/about_price_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "value_value_check"
- @check_answer_label = "Purchase price confirmation"
- @header = "Are you sure?"
+ @copy_key = "sales.soft_validations.value_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/deposit_value_check.rb b/app/models/form/sales/questions/deposit_value_check.rb
index f8d403d9c..71560fa84 100644
--- a/app/models/form/sales/questions/deposit_value_check.rb
+++ b/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" },
diff --git a/app/models/form/sales/questions/handover_date_check.rb b/app/models/form/sales/questions/handover_date_check.rb
index f19ee0196..233c449bb 100644
--- a/app/models/form/sales/questions/handover_date_check.rb
+++ b/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" },
diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb
index 90fcf4545..615238cda 100644
--- a/app/models/form/sales/questions/monthly_charges_value_check.rb
+++ b/app/models/form/sales/questions/monthly_charges_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "monthly_charges_value_check"
- @check_answer_label = "Monthly charges confirmation"
- @header = "Are you sure this is correct?"
+ @copy_key = "sales.soft_validations.monthly_charges_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb b/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb
index 3f8111881..e7f520b43 100644
--- a/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb
+++ b/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" },
diff --git a/app/models/form/sales/questions/staircase_bought_value_check.rb b/app/models/form/sales/questions/staircase_bought_value_check.rb
index 65fe02e66..146e89dfd 100644
--- a/app/models/form/sales/questions/staircase_bought_value_check.rb
+++ b/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" },
diff --git a/app/models/form/sales/questions/staircase_owned_value_check.rb b/app/models/form/sales/questions/staircase_owned_value_check.rb
index eb742b196..3457d60fe 100644
--- a/app/models/form/sales/questions/staircase_owned_value_check.rb
+++ b/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" },
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 92ef1bcbb..af9da2598 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -650,15 +650,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:
- the decimal point
- the frequency, for example every week or every calendar month
- the rent type is correct, for example affordable or social rent
"
- purchase_price:
- title_text: "You told us the purchase price is %{value}."
- hint_text: "This is %{higher_or_lower} than we would expect."
- 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."
@@ -679,14 +670,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%"
- monthly_charges_over_soft_max:
- title_text: "You told us that the monthly charges were %{mscharge}."
- hint_text: "This is higher than we would expect."
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}."
@@ -718,8 +701,6 @@ Make sure these answers are correct."
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."
no_address_found:
diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml
index 3467b9432..104d6e2b5 100644
--- a/config/locales/forms/2023/sales/soft_validations.en.yml
+++ b/config/locales/forms/2023/sales/soft_validations.en.yml
@@ -38,6 +38,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: ""
@@ -49,12 +50,14 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
+
combined_income_value_check:
page_header: ""
check_answer_label: "Combined income confirmation"
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?"
+
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
@@ -62,6 +65,7 @@ en:
question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
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."
+
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
@@ -73,23 +77,76 @@ en:
not_joint_purchase:
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."
+
wheel_value_check:
page_header: ""
check_answer_label: "Does anyone in the household use a wheelchair?"
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: ""
@@ -105,6 +162,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"
@@ -112,6 +170,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"
@@ -119,6 +178,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"
@@ -126,3 +186,13 @@ 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."
+
+
diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml
index 39af6cb38..1a10dcd79 100644
--- a/config/locales/forms/2024/sales/soft_validations.en.yml
+++ b/config/locales/forms/2024/sales/soft_validations.en.yml
@@ -38,6 +38,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: ""
@@ -49,12 +50,14 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
+
combined_income_value_check:
page_header: ""
check_answer_label: "Combined income confirmation"
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?"
+
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
@@ -62,6 +65,7 @@ en:
question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
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."
+
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
@@ -73,23 +77,76 @@ en:
not_joint_purchase:
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."
+
wheel_value_check:
page_header: ""
check_answer_label: "Does anyone in the household use a wheelchair?"
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: ""
@@ -105,6 +162,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"
@@ -112,6 +170,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"
@@ -119,6 +178,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"
@@ -126,3 +186,12 @@ 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."
+
diff --git a/spec/models/form/lettings/subsections/tenancy_information_spec.rb b/spec/models/form/lettings/subsections/tenancy_information_spec.rb
index 96770ea78..4ea4e10f0 100644
--- a/spec/models/form/lettings/subsections/tenancy_information_spec.rb
+++ b/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::Sales::Sections::TenancyInformation, form:) }
let(:form) { instance_double(Form, start_date:) }
before do
diff --git a/spec/models/form/sales/pages/about_price_value_check_spec.rb b/spec/models/form/sales/pages/about_price_value_check_spec.rb
index 7d3c31537..1193768db 100644
--- a/spec/models/form/sales/pages/about_price_value_check_spec.rb
+++ b/spec/models/form/sales/pages/about_price_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do
let(:page_id) { "savings_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)
@@ -28,12 +29,12 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do
end
it "has the correct title_text" do
- expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "value", "key" => "value", "label" => true }], "translation" => "soft_validations.purchase_price.title_text" })
+ expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "value", "key" => "value", "label" => true }], "translation" => "forms.2024.sales.soft_validations.value_value_check.title_text" })
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({
- "translation" => "soft_validations.purchase_price.hint_text",
+ "translation" => "forms.2024.sales.soft_validations.value_value_check.informative_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
diff --git a/spec/models/form/sales/pages/handover_date_check_spec.rb b/spec/models/form/sales/pages/handover_date_check_spec.rb
index f245675d5..ae465da16 100644
--- a/spec/models/form/sales/pages/handover_date_check_spec.rb
+++ b/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
diff --git a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb
index cb187ecfd..ce72bbda8 100644
--- a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb
+++ b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do
let(:page_id) { "monthly_charges_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)
@@ -33,13 +34,13 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.monthly_charges_over_soft_max.title_text",
+ "translation" => "forms.2024.sales.soft_validations.monthly_charges_value_check.title_text",
"arguments" => [{ "arguments_for_key" => "mscharge", "i18n_template" => "mscharge", "key" => "field_formatted_as_currency" }],
})
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.monthly_charges_over_soft_max.hint_text" })
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.monthly_charges_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
diff --git a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
index 3a1c22f24..bca971fe5 100644
--- a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
+++ b/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
diff --git a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb
index 95e59ea4e..5fa65fd8d 100644
--- a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb
+++ b/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",
diff --git a/spec/models/form/sales/questions/deposit_value_check_spec.rb b/spec/models/form/sales/questions/deposit_value_check_spec.rb
index 2e861110a..077c2e6a6 100644
--- a/spec/models/form/sales/questions/deposit_value_check_spec.rb
+++ b/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 }
diff --git a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb
index 4298e40b8..cbff9cec1 100644
--- a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb
+++ b/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 }