Browse Source

feat: update answer options and hint text for 24/25

pull/2214/head
natdeanlewissoftwire 2 years ago
parent
commit
0ceca4e98d
  1. 39
      app/models/form/lettings/questions/starter_tenancy_type.rb
  2. 35
      app/models/form/lettings/questions/tenancy_type.rb

39
app/models/form/lettings/questions/starter_tenancy_type.rb

@ -2,17 +2,46 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancy" @id = "tenancy"
@check_answer_label = "Type of main tenancy after the starter period has ended?" @check_answer_label = form.start_year_after_2024? ? "What is the type of tenancy after the starter or introductory period has ended" : "Type of main tenancy after the starter period has ended?"
@header = "What is the type of tenancy after the starter period has ended?" @header = "What is the type of tenancy after the starter period has ended?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This is also known as an ‘introductory period’." @hint_text = form.start_year_after_2024? ? "" : "This is also known as an ‘introductory period’."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "tenancyother" => [3] } @conditional_for = { "tenancyother" => [3] }
@question_number = 27 @question_number = 27
end end
ANSWER_OPTIONS = { def answer_options
if form.start_year_after_2024?
{
"4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term",
"hint" => "These are mostly provided by housing associations. Fixed term tenancies are intended to be for a set amount of time up to 20 years.",
},
"6" => {
"value" => "Secure – fixed term",
"hint" => "These are mostly provided by local authorities. Fixed term tenancies are intended to be for a set amount of time up to 20 years.",
},
"2" => {
"value" => "Assured – lifetime",
},
"7" => {
"value" => "Secure – lifetime",
},
"8" => {
"value" => "Periodic",
"hint" => "These are rolling tenancies with no fixed end date. They may have an initial fixed term and then become rolling.",
},
"5" => {
"value" => "Licence agreement",
"hint" => "These are mostly used for Supported Housing and work on a rolling basis.",
},
"3" => {
"value" => "Other",
},
}.freeze
else
{
"4" => { "4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term", "value" => "Assured Shorthold Tenancy (AST) – Fixed term",
"hint" => "Mostly housing associations provide these. Fixed term tenancies are intended to be for a set amount of time up to 20 years.", "hint" => "Mostly housing associations provide these. Fixed term tenancies are intended to be for a set amount of time up to 20 years.",
@ -36,3 +65,5 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question
}, },
}.freeze }.freeze
end end
end
end

35
app/models/form/lettings/questions/tenancy_type.rb

@ -7,12 +7,41 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "" @hint_text = ""
@answer_options = ANSWER_OPTIONS
@conditional_for = { "tenancyother" => [3] } @conditional_for = { "tenancyother" => [3] }
@question_number = 27 @question_number = 27
end end
ANSWER_OPTIONS = { def answer_options
if form.start_year_after_2024?
{
"4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term",
"hint" => "These are mostly provided by housing associations. Fixed term tenancies are intended to be for a set amount of time up to 20 years.",
},
"6" => {
"value" => "Secure – fixed term",
"hint" => "These are mostly provided by local authorities. Fixed term tenancies are intended to be for a set amount of time up to 20 years.",
},
"2" => {
"value" => "Assured – lifetime",
},
"7" => {
"value" => "Secure – lifetime",
},
"8" => {
"value" => "Periodic",
"hint" => "These are rolling tenancies with no fixed end date. They may have an initial fixed term and then become rolling.",
},
"5" => {
"value" => "Licence agreement",
"hint" => "These are mostly used for Supported Housing and work on a rolling basis.",
},
"3" => {
"value" => "Other",
},
}.freeze
else
{
"4" => { "4" => {
"value" => "Assured Shorthold Tenancy (AST) – Fixed term", "value" => "Assured Shorthold Tenancy (AST) – Fixed term",
"hint" => "Mostly housing associations provide these. Fixed term tenancies are intended to be for a set amount of time up to 20 years.", "hint" => "Mostly housing associations provide these. Fixed term tenancies are intended to be for a set amount of time up to 20 years.",
@ -36,3 +65,5 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question
}, },
}.freeze }.freeze
end end
end
end

Loading…
Cancel
Save