diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index 08fc8e56d..fdffeaaa6 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/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) super @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?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "This is also known as an ‘introductory period’." - @answer_options = ANSWER_OPTIONS + @hint_text = form.start_year_after_2024? ? "" : "This is also known as an ‘introductory period’." @conditional_for = { "tenancyother" => [3] } @question_number = 27 end - ANSWER_OPTIONS = { - "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 + 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" => { + "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 diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index 95beffbca..6a7642123 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -7,32 +7,63 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question @type = "radio" @check_answers_card_number = 0 @hint_text = "" - @answer_options = ANSWER_OPTIONS @conditional_for = { "tenancyother" => [3] } @question_number = 27 end - ANSWER_OPTIONS = { - "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 + 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" => { + "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