Browse Source

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

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

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

@ -2,37 +2,68 @@ 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
"4" => { if form.start_year_after_2024?
"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.", "4" => {
}, "value" => "Assured Shorthold Tenancy (AST) – Fixed term",
"6" => { "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.",
"value" => "Secure – fixed term", },
"hint" => "Mostly local authorities provide these. Fixed term tenancies are intended to be for a set amount of time up to 20 years.", "6" => {
}, "value" => "Secure – fixed term",
"2" => { "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.",
"value" => "Assured – lifetime", },
}, "2" => {
"7" => { "value" => "Assured – lifetime",
"value" => "Secure – lifetime", },
}, "7" => {
"5" => { "value" => "Secure – lifetime",
"value" => "Licence agreement", },
"hint" => "Licence agreements are mostly used for Supported Housing and work on a rolling basis.", "8" => {
}, "value" => "Periodic",
"3" => { "hint" => "These are rolling tenancies with no fixed end date. They may have an initial fixed term and then become rolling.",
"value" => "Other", },
}, "5" => {
}.freeze "value" => "Licence agreement",
"hint" => "These are mostly used for Supported Housing and work on a rolling basis.",
},
"3" => {
"value" => "Other",
},
}.freeze
else
{
"4" => {
"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.",
},
"6" => {
"value" => "Secure – fixed term",
"hint" => "Mostly local authorities provide these. 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",
},
"5" => {
"value" => "Licence agreement",
"hint" => "Licence agreements are mostly used for Supported Housing and work on a rolling basis.",
},
"3" => {
"value" => "Other",
},
}.freeze
end
end
end end

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

@ -7,32 +7,63 @@ 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
"4" => { if form.start_year_after_2024?
"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.", "4" => {
}, "value" => "Assured Shorthold Tenancy (AST) – Fixed term",
"6" => { "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.",
"value" => "Secure – fixed term", },
"hint" => "Mostly local authorities provide these. Fixed term tenancies are intended to be for a set amount of time up to 20 years.", "6" => {
}, "value" => "Secure – fixed term",
"2" => { "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.",
"value" => "Assured – lifetime", },
}, "2" => {
"7" => { "value" => "Assured – lifetime",
"value" => "Secure – lifetime", },
}, "7" => {
"5" => { "value" => "Secure – lifetime",
"value" => "Licence agreement", },
"hint" => "Licence agreements are mostly used for Supported Housing and work on a rolling basis.", "8" => {
}, "value" => "Periodic",
"3" => { "hint" => "These are rolling tenancies with no fixed end date. They may have an initial fixed term and then become rolling.",
"value" => "Other", },
}, "5" => {
}.freeze "value" => "Licence agreement",
"hint" => "These are mostly used for Supported Housing and work on a rolling basis.",
},
"3" => {
"value" => "Other",
},
}.freeze
else
{
"4" => {
"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.",
},
"6" => {
"value" => "Secure – fixed term",
"hint" => "Mostly local authorities provide these. 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",
},
"5" => {
"value" => "Licence agreement",
"hint" => "Licence agreements are mostly used for Supported Housing and work on a rolling basis.",
},
"3" => {
"value" => "Other",
},
}.freeze
end
end
end end

Loading…
Cancel
Save