diff --git a/app/models/form/sales/pages/discounted_ownership_type.rb b/app/models/form/sales/pages/discounted_ownership_type.rb index 02eb8e1bd..0455f9b3c 100644 --- a/app/models/form/sales/pages/discounted_ownership_type.rb +++ b/app/models/form/sales/pages/discounted_ownership_type.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "discounted_ownership_type" - @header = "Discounted ownership type" + @header = header @depends_on = [{ "ownershipsch" => 2, }] @@ -13,4 +13,8 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page Form::Sales::Questions::DiscountedOwnershipType.new(nil, nil, self), ] end + + def header + "Discounted ownership type" if form.start_date.year >= 2023 + end end diff --git a/app/models/form/sales/pages/outright_ownership_type.rb b/app/models/form/sales/pages/outright_ownership_type.rb index 297102f73..32ff07d74 100644 --- a/app/models/form/sales/pages/outright_ownership_type.rb +++ b/app/models/form/sales/pages/outright_ownership_type.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "outright_ownership_type" - @header = "Outright ownership type" + @header = header @depends_on = [{ "ownershipsch" => 3, }] @@ -14,4 +14,8 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page Form::Sales::Questions::OtherOwnershipType.new(nil, nil, self), ] end + + def header + "Outright ownership type" if form.start_date.year >= 2023 + end end diff --git a/app/models/form/sales/pages/shared_ownership_type.rb b/app/models/form/sales/pages/shared_ownership_type.rb index 90565659d..a3566b914 100644 --- a/app/models/form/sales/pages/shared_ownership_type.rb +++ b/app/models/form/sales/pages/shared_ownership_type.rb @@ -2,12 +2,16 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "shared_ownership_type" - @header = "Shared Ownership" + @header = header @depends_on = [{ "ownershipsch" => 1, }] end + def header + "Shared ownership type" if form.start_date.year >= 2023 + end + def questions @questions ||= [ Form::Sales::Questions::SharedOwnershipType.new(nil, nil, self), diff --git a/app/models/form/sales/questions/discounted_ownership_type.rb b/app/models/form/sales/questions/discounted_ownership_type.rb index 5d19e6592..aeb00fac1 100644 --- a/app/models/form/sales/questions/discounted_ownership_type.rb +++ b/app/models/form/sales/questions/discounted_ownership_type.rb @@ -5,7 +5,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question @check_answer_label = "Type of discounted ownership sale" @header = "What is the type of discounted ownership sale?" @type = "radio" - @guidance_partial = "discounted_ownership_type_definitions" + @guidance_partial = guidance_partial @guidance_position = GuidancePosition::TOP @answer_options = ANSWER_OPTIONS @question_number = 5 @@ -20,4 +20,8 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question "21" => { "value" => "Social HomeBuy for outright purchase" }, "22" => { "value" => "Any other equity loan scheme" }, }.freeze + + def guidance_partial + "discounted_ownership_type_definitions" if form.start_date.year >= 2023 + end end diff --git a/app/models/form/sales/questions/outright_ownership_type.rb b/app/models/form/sales/questions/outright_ownership_type.rb index e6f535541..71fa86e65 100644 --- a/app/models/form/sales/questions/outright_ownership_type.rb +++ b/app/models/form/sales/questions/outright_ownership_type.rb @@ -5,7 +5,7 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question @check_answer_label = "Type of outright sale" @header = "What is the type of outright sale?" @type = "radio" - @guidance_partial = "outright_sale_type_definitions" + @guidance_partial = guidance_partial @guidance_position = GuidancePosition::TOP @answer_options = ANSWER_OPTIONS @conditional_for = { @@ -18,4 +18,8 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question "10" => { "value" => "Outright" }, "12" => { "value" => "Other sale" }, }.freeze + + def guidance_partial + "outright_sale_type_definitions" if form.start_date.year >= 2023 + end end diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb index a434783a4..053af2e1a 100644 --- a/app/models/form/sales/questions/shared_ownership_type.rb +++ b/app/models/form/sales/questions/shared_ownership_type.rb @@ -5,7 +5,7 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question @check_answer_label = "Type of shared ownership sale" @header = "What is the 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" - @guidance_partial = "shared_ownership_type_definitions" + @guidance_partial = guidance_partial @guidance_position = GuidancePosition::TOP @type = "radio" @answer_options = answer_options @@ -36,4 +36,8 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question } end end + + def guidance_partial + "shared_ownership_type_definitions" if form.start_date.year >= 2023 + end end