From bd47018f4712c38a87243c3702abe9ccf21b0795 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Thu, 3 Oct 2024 17:31:10 +0100 Subject: [PATCH] CLDC-3650: Pull out copy for sales setup section questions to translation file --- app/models/form/page.rb | 6 + app/models/form/question.rb | 19 +++ app/models/form/sales/pages/buyer_company.rb | 1 + .../form/sales/pages/buyer_interview.rb | 1 + app/models/form/sales/pages/buyer_live.rb | 1 + app/models/form/sales/pages/created_by.rb | 1 + .../sales/pages/discounted_ownership_type.rb | 5 +- app/models/form/sales/pages/joint_purchase.rb | 1 + .../form/sales/pages/managing_organisation.rb | 1 + .../form/sales/pages/number_joint_buyers.rb | 1 + .../form/sales/pages/ownership_scheme.rb | 1 + .../form/sales/pages/owning_organisation.rb | 1 + app/models/form/sales/pages/purchaser_code.rb | 1 + app/models/form/sales/pages/sale_date.rb | 1 + .../form/sales/pages/shared_ownership_type.rb | 5 +- .../form/sales/questions/buyer_company.rb | 3 +- .../form/sales/questions/buyer_interview.rb | 4 +- app/models/form/sales/questions/buyer_live.rb | 3 +- .../form/sales/questions/created_by_id.rb | 4 +- .../questions/discounted_ownership_type.rb | 3 +- .../form/sales/questions/joint_purchase.rb | 9 +- .../sales/questions/managing_organisation.rb | 4 +- .../sales/questions/number_joint_buyers.rb | 11 +- .../form/sales/questions/ownership_scheme.rb | 4 +- .../sales/questions/owning_organisation_id.rb | 4 +- .../form/sales/questions/privacy_notice.rb | 3 +- .../form/sales/questions/purchaser_code.rb | 4 +- app/models/form/sales/questions/sale_date.rb | 4 +- .../sales/questions/shared_ownership_type.rb | 11 +- config/locales/forms/2023/sales/setup.en.yml | 110 ++++++++++++++++++ config/locales/forms/2024/sales/setup.en.yml | 73 +++++++++++- 31 files changed, 234 insertions(+), 66 deletions(-) create mode 100644 config/locales/forms/2023/sales/setup.en.yml diff --git a/app/models/form/page.rb b/app/models/form/page.rb index f1d6497a0..d6403cf2d 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -24,6 +24,12 @@ class Form::Page delegate :form, to: :subsection + def header + @header if @copy_key.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.page_header") + end + def routed_to?(log, _current_user) return true unless depends_on || subsection.depends_on diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 1fbced841..dac903a5a 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -11,6 +11,7 @@ class Form::Question def initialize(id, hsh, page) @id = id @page = page + @copy_reference = nil if hsh @check_answer_label = hsh["check_answer_label"] @header = hsh["header"] @@ -48,6 +49,24 @@ class Form::Question delegate :subsection, to: :page delegate :form, to: :subsection + def check_answer_label + return @check_answer_label if @copy_reference.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.check_answer_label") + end + + def header + return @header if @copy_key.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.question_text") + end + + def hint_text + return @hint_text if @copy_key.nil? + + I18n.t("forms.#{form.start_date.year}.#{@copy_key}.hint_text") + end + def answer_label(log, user = nil) return checkbox_answer_label(log) if type == "checkbox" return log[id]&.to_formatted_s(:govuk_date).to_s if type == "date" diff --git a/app/models/form/sales/pages/buyer_company.rb b/app/models/form/sales/pages/buyer_company.rb index dbe1afcec..cc2d962fe 100644 --- a/app/models/form/sales/pages/buyer_company.rb +++ b/app/models/form/sales/pages/buyer_company.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerCompany < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_company" + @copy_key = "sales.setup.companybuy" @depends_on = [{ "outright_sale?" => true, }] diff --git a/app/models/form/sales/pages/buyer_interview.rb b/app/models/form/sales/pages/buyer_interview.rb index f9c4e3bbc..d042db288 100644 --- a/app/models/form/sales/pages/buyer_interview.rb +++ b/app/models/form/sales/pages/buyer_interview.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerInterview < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) @joint_purchase = joint_purchase + @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" end def questions diff --git a/app/models/form/sales/pages/buyer_live.rb b/app/models/form/sales/pages/buyer_live.rb index d0b772355..6606f8ed4 100644 --- a/app/models/form/sales/pages/buyer_live.rb +++ b/app/models/form/sales/pages/buyer_live.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerLive < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_live" + @copy_key = "sales.setup.buylivein" @depends_on = [{ "companybuy" => 2, }] diff --git a/app/models/form/sales/pages/created_by.rb b/app/models/form/sales/pages/created_by.rb index e68fc6a30..d40b522df 100644 --- a/app/models/form/sales/pages/created_by.rb +++ b/app/models/form/sales/pages/created_by.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::CreatedBy < ::Form::Page def initialize(id, hsh, subsection) super @id = "assigned_to" + @copy_key = "assigned_to_id" end def questions diff --git a/app/models/form/sales/pages/discounted_ownership_type.rb b/app/models/form/sales/pages/discounted_ownership_type.rb index 3fe2011ef..346ad4467 100644 --- a/app/models/form/sales/pages/discounted_ownership_type.rb +++ b/app/models/form/sales/pages/discounted_ownership_type.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "discounted_ownership_type" + @copy_key = "sales.setup.type.discounted_ownership" @header = header @depends_on = [{ "ownershipsch" => 2, @@ -13,8 +14,4 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page Form::Sales::Questions::DiscountedOwnershipType.new(nil, nil, self), ] end - - def header - "Type of discounted ownership sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/pages/joint_purchase.rb b/app/models/form/sales/pages/joint_purchase.rb index bec7c88c1..e3b0156b7 100644 --- a/app/models/form/sales/pages/joint_purchase.rb +++ b/app/models/form/sales/pages/joint_purchase.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::JointPurchase < ::Form::Page def initialize(id, hsh, subsection) super @id = "joint_purchase" + @copy_key = "sales.setup.jointpur" @depends_on = [ { "ownershipsch" => 1 }, { "ownershipsch" => 2 }, diff --git a/app/models/form/sales/pages/managing_organisation.rb b/app/models/form/sales/pages/managing_organisation.rb index 3d8e59383..bbb046f6b 100644 --- a/app/models/form/sales/pages/managing_organisation.rb +++ b/app/models/form/sales/pages/managing_organisation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::ManagingOrganisation < ::Form::Page def initialize(id, hsh, subsection) super @id = "managing_organisation" + @copy_key = "sales.setup.managing_organisation_id" end def questions diff --git a/app/models/form/sales/pages/number_joint_buyers.rb b/app/models/form/sales/pages/number_joint_buyers.rb index 3a8c3475d..456fb61e9 100644 --- a/app/models/form/sales/pages/number_joint_buyers.rb +++ b/app/models/form/sales/pages/number_joint_buyers.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::NumberJointBuyers < ::Form::Page def initialize(id, hsh, subsection) super @id = "number_joint_buyers" + @copy_key = "sales.setup.jointmore" @depends_on = [{ "joint_purchase?" => true, }] diff --git a/app/models/form/sales/pages/ownership_scheme.rb b/app/models/form/sales/pages/ownership_scheme.rb index d92e56600..6e1ca5cfe 100644 --- a/app/models/form/sales/pages/ownership_scheme.rb +++ b/app/models/form/sales/pages/ownership_scheme.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::OwnershipScheme < ::Form::Page def initialize(id, hsh, subsection) super @id = "ownership_scheme" + @copy_key = "sales.setup.ownershipsch" end def questions diff --git a/app/models/form/sales/pages/owning_organisation.rb b/app/models/form/sales/pages/owning_organisation.rb index f0c9e4e68..e3b093b83 100644 --- a/app/models/form/sales/pages/owning_organisation.rb +++ b/app/models/form/sales/pages/owning_organisation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::OwningOrganisation < ::Form::Page def initialize(id, hsh, subsection) super @id = "owning_organisation" + @copy_key = "sales.setup.owning_organisation_id" end def questions diff --git a/app/models/form/sales/pages/purchaser_code.rb b/app/models/form/sales/pages/purchaser_code.rb index 8282453ad..ec61d50dd 100644 --- a/app/models/form/sales/pages/purchaser_code.rb +++ b/app/models/form/sales/pages/purchaser_code.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::PurchaserCode < ::Form::Page def initialize(id, hsh, subsection) super @id = "purchaser_code" + @copy_key = "sales.setup.purchid" end def questions diff --git a/app/models/form/sales/pages/sale_date.rb b/app/models/form/sales/pages/sale_date.rb index 036e04907..3a9432623 100644 --- a/app/models/form/sales/pages/sale_date.rb +++ b/app/models/form/sales/pages/sale_date.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::SaleDate < ::Form::Page def initialize(id, hsh, subsection) super @id = "completion_date" + @copy_key = "sales.setup.saledate" end def questions diff --git a/app/models/form/sales/pages/shared_ownership_type.rb b/app/models/form/sales/pages/shared_ownership_type.rb index 3e65cb628..304c58730 100644 --- a/app/models/form/sales/pages/shared_ownership_type.rb +++ b/app/models/form/sales/pages/shared_ownership_type.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "shared_ownership_type" + @copy_key = "sales.setup.type.shared_ownership" @header = header @depends_on = [{ "ownershipsch" => 1, @@ -13,8 +14,4 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page Form::Sales::Questions::SharedOwnershipType.new(nil, nil, self), ] end - - def header - "Type of shared ownership sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/questions/buyer_company.rb b/app/models/form/sales/questions/buyer_company.rb index 40763c818..9ca551e70 100644 --- a/app/models/form/sales/questions/buyer_company.rb +++ b/app/models/form/sales/questions/buyer_company.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question def initialize(id, hsh, page) super @id = "companybuy" - @check_answer_label = "Company buyer" - @header = "Is the buyer a company?" + @copy_key = "sales.setup.companybuy" @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] diff --git a/app/models/form/sales/questions/buyer_interview.rb b/app/models/form/sales/questions/buyer_interview.rb index 4e7946151..8b434d11c 100644 --- a/app/models/form/sales/questions/buyer_interview.rb +++ b/app/models/form/sales/questions/buyer_interview.rb @@ -2,10 +2,8 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "noint" - @check_answer_label = "#{joint_purchase ? 'Buyers' : 'Buyer'} interviewed in person?" - @header = "#{joint_purchase ? 'Were the buyers' : 'Was the buyer'} interviewed for any of the answers you will provide on this log?" + @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "radio" - @hint_text = "You should still try to answer all questions even if the #{joint_purchase ? 'buyers weren’t' : 'buyer wasn’t'} interviewed in person" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/buyer_live.rb b/app/models/form/sales/questions/buyer_live.rb index 77153de0b..794b3c7bc 100644 --- a/app/models/form/sales/questions/buyer_live.rb +++ b/app/models/form/sales/questions/buyer_live.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::BuyerLive < ::Form::Question def initialize(id, hsh, page) super @id = "buylivein" - @check_answer_label = "Buyers living in property" - @header = form.start_year_after_2024? ? "Will any buyers live in the property?" : "Will the buyers live in the property?" + @copy_key = "sales.setup.buylivein" @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] diff --git a/app/models/form/sales/questions/created_by_id.rb b/app/models/form/sales/questions/created_by_id.rb index 810c4966d..f4a40daff 100644 --- a/app/models/form/sales/questions/created_by_id.rb +++ b/app/models/form/sales/questions/created_by_id.rb @@ -4,9 +4,7 @@ class Form::Sales::Questions::CreatedById < ::Form::Question def initialize(id, hsh, page) super @id = "assigned_to_id" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.question_text") - @hint = I18n.t("forms.#{form.start_date.year}.sales.setup.assigned_to_id.hint_text") + @copy_key = "sales.setup.assigned_to_id" @derived = true @type = "select" end diff --git a/app/models/form/sales/questions/discounted_ownership_type.rb b/app/models/form/sales/questions/discounted_ownership_type.rb index e4062d485..6108e4ef8 100644 --- a/app/models/form/sales/questions/discounted_ownership_type.rb +++ b/app/models/form/sales/questions/discounted_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of discounted ownership sale" - @header = "What is the type of discounted ownership sale?" + @copy_key = "sales.setup.type.discounted_ownership" @type = "radio" @top_guidance_partial = guidance_partial @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/joint_purchase.rb b/app/models/form/sales/questions/joint_purchase.rb index 27da46bc0..9e47ca7a3 100644 --- a/app/models/form/sales/questions/joint_purchase.rb +++ b/app/models/form/sales/questions/joint_purchase.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question def initialize(id, hsh, page) super @id = "jointpur" - @check_answer_label = "Joint purchase" - @header = "Is this a joint purchase?" + @copy_key = "sales.setup.jointpur" @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] @@ -14,11 +13,5 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question "2" => { "value" => "No" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This is where two or more people are named as legal owners of the property after the purchase" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 11 }.freeze end diff --git a/app/models/form/sales/questions/managing_organisation.rb b/app/models/form/sales/questions/managing_organisation.rb index 2c2f219cc..f934a0cc7 100644 --- a/app/models/form/sales/questions/managing_organisation.rb +++ b/app/models/form/sales/questions/managing_organisation.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question def initialize(id, hsh, page) super @id = "managing_organisation_id" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.question_text") - @hint = I18n.t("forms.#{form.start_date.year}.sales.setup.managing_organisation_id.hint_text") + @copy_key = "sales.setup.managing_organisation_id" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/number_joint_buyers.rb b/app/models/form/sales/questions/number_joint_buyers.rb index 95117bb44..147f78ef5 100644 --- a/app/models/form/sales/questions/number_joint_buyers.rb +++ b/app/models/form/sales/questions/number_joint_buyers.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question def initialize(id, hsh, page) super @id = "jointmore" - @check_answer_label = "More than 2 joint buyers" - @header = "Are there more than 2 joint buyers of this property?" + @copy_key = "sales.setup.jointmore" @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] @@ -15,13 +14,5 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - def hint_text - if form.start_year_after_2024? - nil - else - "You should still try to answer all questions even if the buyers weren’t interviewed in person" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 12 }.freeze end diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 770040e5e..38a97e824 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question def initialize(id, hsh, page) super @id = "ownershipsch" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.hint_text") + @copy_key = "sales.setup.ownershipsch" @type = "radio" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/owning_organisation_id.rb b/app/models/form/sales/questions/owning_organisation_id.rb index 593ec3951..adf777b48 100644 --- a/app/models/form/sales/questions/owning_organisation_id.rb +++ b/app/models/form/sales/questions/owning_organisation_id.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question def initialize(id, hsh, page) super @id = "owning_organisation_id" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.owning_organisation_id.hint_text") + @copy_key = "sales.setup.owning_organisation_id" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 6e53f36ff..a9e737f0e 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "privacynotice" - @check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?" - @header = "Declaration" + @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "checkbox" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @joint_purchase = joint_purchase diff --git a/app/models/form/sales/questions/purchaser_code.rb b/app/models/form/sales/questions/purchaser_code.rb index 03f88a936..527dd659a 100644 --- a/app/models/form/sales/questions/purchaser_code.rb +++ b/app/models/form/sales/questions/purchaser_code.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question def initialize(id, hsh, page) super @id = "purchid" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.hint_text") + @copy_key = "sales.setup.purchid" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/sale_date.rb b/app/models/form/sales/questions/sale_date.rb index d850f8904..f969c32f2 100644 --- a/app/models/form/sales/questions/sale_date.rb +++ b/app/models/form/sales/questions/sale_date.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::SaleDate < ::Form::Question def initialize(id, hsh, page) super @id = "saledate" - @check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.check_answer_label") - @header = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.question_text") - @hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.hint_text") + @copy_key = "sales.setup.saledate" @type = "date" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb index 4c1879888..1ede14a4d 100644 --- a/app/models/form/sales/questions/shared_ownership_type.rb +++ b/app/models/form/sales/questions/shared_ownership_type.rb @@ -2,22 +2,13 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of shared ownership sale" - @header = "What is the type of shared ownership sale?" + @copy_key = "sales.setup.type.shared_ownership" @top_guidance_partial = guidance_partial @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] end - def hint_text - if form.start_year_after_2024? - "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" - else - "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" - end - end - def answer_options if form.start_date.year >= 2023 { diff --git a/config/locales/forms/2023/sales/setup.en.yml b/config/locales/forms/2023/sales/setup.en.yml new file mode 100644 index 000000000..bed55803a --- /dev/null +++ b/config/locales/forms/2023/sales/setup.en.yml @@ -0,0 +1,110 @@ +en: + forms: + 2023: + sales: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + saledate: + page_header: "" + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + page_header: "" + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownershipsch: + page_header: "" + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + check_answer_label: "Type of discounted ownership sale" + hint_text: "" + question_text: "What is the type of discounted ownership sale?" + outright_ownership: + page_header: "Type of outright sale page" + type: + check_answer_label: "Type of outright sale" + hint_text: "" + question_text: "What is the type of outright sale?" + othtype: + check_answer_label: "Type of other sale" + hint_text: "" + question_text: "What type of sale is it?" + + companybuy: + page_header: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will the buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren't interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn't interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + + privacynotice: + joint_purchase: + page_header: "" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml index 7e6f8878b..2434817f1 100644 --- a/config/locales/forms/2024/sales/setup.en.yml +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -4,36 +4,107 @@ en: sales: setup: owning_organisation_id: + page_header: "" check_answer_label: "Owning organisation" hint_text: "" question_text: "Which organisation owns this log?" managing_organisation_id: + page_header: "" check_answer_label: "Reported by" hint_text: "" question_text: "Which organisation is reporting this sale?" assigned_to_id: + page_header: "" check_answer_label: "Log owner" hint_text: "" question_text: "Which user are you creating this log for?" saledate: + page_header: "" check_answer_label: "Sale completion date" hint_text: "" question_text: "What is the sale completion date?" purchid: + page_header: "" check_answer_label: "Purchaser code" hint_text: "This is how you usually refer to the purchaser on your own systems." question_text: "What is the purchaser code?" - ownerschipsch: + ownershipsch: + page_header: "" check_answer_label: "Purchase made under ownership scheme" hint_text: "" question_text: "Was this purchase made through an ownership scheme?" type: shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + check_answer_label: "Type of discounted ownership sale" + hint_text: "" + question_text: "What is the type of discounted ownership sale?" + outright_ownership: + page_header: "Type of outright sale page" + type: + check_answer_label: "Type of outright sale" + hint_text: "" + question_text: "What is the type of outright sale?" + othtype: + check_answer_label: "Type of other sale" + hint_text: "" + question_text: "What type of sale is it?" + companybuy: + page_header: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will any buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "This is where two or more people are named as legal owners of the property after the purchase" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren't interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn't interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + privacynotice: + joint_purchase: + page_header: "" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration"