Browse Source

CLDC-3129: Update UPRN question (#2157)

* CLDC-3129: Update UPRN known hint text

* CLDC-3129: Move sales UPRN questions to start of property information section for 2024

* Refactor sales property information subsection for more clarity
pull/2171/head
Rachael Booth 11 months ago committed by GitHub
parent
commit
c83bd18c42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      app/models/form/lettings/questions/uprn_known.rb
  2. 5
      app/models/form/sales/questions/uprn_known.rb
  3. 12
      app/models/form/sales/subsections/property_information.rb
  4. 5
      spec/models/form/lettings/questions/uprn_known_spec.rb
  5. 5
      spec/models/form/sales/questions/uprn_known_spec.rb
  6. 26
      spec/models/form/sales/subsections/property_information_spec.rb

5
app/models/form/lettings/questions/uprn_known.rb

@ -6,8 +6,9 @@ class Form::Lettings::Questions::UprnKnown < ::Form::Question
@header = "Do you know the property's UPRN?" @header = "Do you know the property's UPRN?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and sectors UK-wide. For example 10010457355.<br><br> @hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
You can continue without the UPRN, but it means we will need you to enter the address of the property." The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you dont know the UPRN you can enter the address of the property instead on the next screen."
@conditional_for = { "uprn" => [1] } @conditional_for = { "uprn" => [1] }
@inferred_check_answers_value = [ @inferred_check_answers_value = [
{ {

5
app/models/form/sales/questions/uprn_known.rb

@ -6,8 +6,9 @@ class Form::Sales::Questions::UprnKnown < ::Form::Question
@header = "Do you know the property's UPRN?" @header = "Do you know the property's UPRN?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and sectors UK-wide. For example 10010457355.<br><br> @hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
You can continue without the UPRN, but it means we will need you to enter the address of the property." The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you dont know the UPRN you can enter the address of the property instead on the next screen."
@conditional_for = { "uprn" => [1] } @conditional_for = { "uprn" => [1] }
@inferred_check_answers_value = [ @inferred_check_answers_value = [
{ {

12
app/models/form/sales/subsections/property_information.rb

@ -8,21 +8,20 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
def pages def pages
@pages ||= [ @pages ||= [
(uprn_questions if form.start_date.year >= 2024),
Form::Sales::Pages::PropertyNumberOfBedrooms.new(nil, nil, self), Form::Sales::Pages::PropertyNumberOfBedrooms.new(nil, nil, self),
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_bedrooms_value_check", nil, self), Form::Sales::Pages::AboutPriceValueCheck.new("about_price_bedrooms_value_check", nil, self),
Form::Sales::Pages::PropertyUnitType.new(nil, nil, self), Form::Sales::Pages::PropertyUnitType.new(nil, nil, self),
Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_property_type_value_check", nil, self), Form::Sales::Pages::MonthlyChargesValueCheck.new("monthly_charges_property_type_value_check", nil, self),
Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self), Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self),
Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self), Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self),
uprn_questions, (uprn_questions if form.start_date.year == 2023),
postcode_and_la_questions, (postcode_and_la_questions if form.start_date.year < 2023),
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self),
Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self), Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
].flatten.compact ].flatten.compact
end end
def uprn_questions def uprn_questions
if form.start_date.year >= 2023
[ [
Form::Sales::Pages::Uprn.new(nil, nil, self), Form::Sales::Pages::Uprn.new(nil, nil, self),
Form::Sales::Pages::UprnConfirmation.new(nil, nil, self), Form::Sales::Pages::UprnConfirmation.new(nil, nil, self),
@ -31,19 +30,18 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil), Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil), Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil), Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self),
] ]
end end
end
def postcode_and_la_questions def postcode_and_la_questions
if form.start_date.year < 2023
[ [
Form::Sales::Pages::Postcode.new(nil, nil, self), Form::Sales::Pages::Postcode.new(nil, nil, self),
Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self), Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self),
Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil), Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil), Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil), Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil),
Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self),
] ]
end end
end
end end

5
spec/models/form/lettings/questions/uprn_known_spec.rb

@ -48,8 +48,9 @@ RSpec.describe Form::Lettings::Questions::UprnKnown, type: :model do
it "has the correct hint" do it "has the correct hint" do
expect(question.hint_text).to eq( expect(question.hint_text).to eq(
"The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and sectors UK-wide. For example 10010457355.<br><br> "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
You can continue without the UPRN, but it means we will need you to enter the address of the property.", The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you dont know the UPRN you can enter the address of the property instead on the next screen.",
) )
end end

5
spec/models/form/sales/questions/uprn_known_spec.rb

@ -48,8 +48,9 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do
it "has the correct hint" do it "has the correct hint" do
expect(question.hint_text).to eq( expect(question.hint_text).to eq(
"The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and sectors UK-wide. For example 10010457355.<br><br> "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
You can continue without the UPRN, but it means we will need you to enter the address of the property.", The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you dont know the UPRN you can enter the address of the property instead on the next screen.",
) )
end end

26
spec/models/form/sales/subsections/property_information_spec.rb

@ -63,6 +63,32 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do
) )
end end
end end
context "when 2024" do
let(:start_date) { Time.utc(2024, 2, 8) }
it "has correct pages" do
expect(property_information.pages.map(&:id)).to eq(
%w[
uprn
uprn_confirmation
address
property_local_authority
local_authority_buyer_1_income_max_value_check
local_authority_buyer_2_income_max_value_check
local_authority_combined_income_max_value_check
about_price_la_value_check
property_number_of_bedrooms
about_price_bedrooms_value_check
property_unit_type
monthly_charges_property_type_value_check
percentage_discount_proptype_value_check
property_building_type
property_wheelchair_accessible
],
)
end
end
end end
it "has the correct id" do it "has the correct id" do

Loading…
Cancel
Save