From b2f00a22868ac01a808d611dcc76d50ca78424c7 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 1 Feb 2023 12:38:29 +0000 Subject: [PATCH] Backfill referral questions --- .../form/lettings/pages/referral_prp.rb | 2 +- .../pages/referral_supported_housing.rb | 2 +- .../pages/referral_supported_housing_prp.rb | 2 +- .../form/lettings/questions/referral.rb | 39 +++++++++++++- .../form/lettings/questions/referral_prp.rb | 51 +++++++++++++++++++ .../questions/referral_supported_housing.rb | 51 +++++++++++++++++++ .../referral_supported_housing_prp.rb | 26 ++++++++++ 7 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 app/models/form/lettings/questions/referral_prp.rb create mode 100644 app/models/form/lettings/questions/referral_supported_housing.rb create mode 100644 app/models/form/lettings/questions/referral_supported_housing_prp.rb diff --git a/app/models/form/lettings/pages/referral_prp.rb b/app/models/form/lettings/pages/referral_prp.rb index dce4b7893..40cefc671 100644 --- a/app/models/form/lettings/pages/referral_prp.rb +++ b/app/models/form/lettings/pages/referral_prp.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::ReferralPrp.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/referral_supported_housing.rb b/app/models/form/lettings/pages/referral_supported_housing.rb index 10d3b2623..a361c0546 100644 --- a/app/models/form/lettings/pages/referral_supported_housing.rb +++ b/app/models/form/lettings/pages/referral_supported_housing.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::ReferralSupportedHousing.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/pages/referral_supported_housing_prp.rb b/app/models/form/lettings/pages/referral_supported_housing_prp.rb index 80a24ef2e..07c1844c3 100644 --- a/app/models/form/lettings/pages/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/pages/referral_supported_housing_prp.rb @@ -8,6 +8,6 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page end def questions - @questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] + @questions ||= [Form::Lettings::Questions::ReferralSupportedHousingPrp.new(nil, nil, self)] end end diff --git a/app/models/form/lettings/questions/referral.rb b/app/models/form/lettings/questions/referral.rb index 7e5aec9c2..83e5d3ae2 100644 --- a/app/models/form/lettings/questions/referral.rb +++ b/app/models/form/lettings/questions/referral.rb @@ -10,5 +10,42 @@ class Form::Lettings::Questions::Referral < ::Form::Question @answer_options = ANSWER_OPTIONS end - ANSWER_OPTIONS = { "1" => { "value" => "Internal transfer" }, "2" => { "value" => "Tenant applied directly (no referral or nomination)" }, "3" => { "value" => "Nominated by a local housing authority" }, "4" => { "value" => "Referred by local authority housing department" }, "8" => { "value" => "Re-located through official housing mobility scheme" }, "10" => { "value" => "Other social landlord" }, "9" => { "value" => "Community learning disability team" }, "14" => { "value" => "Community mental health team" }, "15" => { "value" => "Health service" }, "12" => { "value" => "Police, probation or prison" }, "7" => { "value" => "Voluntary agency" }, "13" => { "value" => "Youth offending team" }, "16" => { "value" => "Other" } }.freeze + ANSWER_OPTIONS = { + "1" => { + "value" => "Internal transfer", + }, + "2" => { + "value" => "Tenant applied directly (no referral or nomination)", + }, + "8" => { + "value" => "Re-located through official housing mobility scheme", + }, + "10" => { + "value" => "Other social landlord", + }, + "9" => { + "value" => "Community learning disability team", + }, + "14" => { + "value" => "Community mental health team", + }, + "15" => { + "value" => "Health service", + }, + "12" => { + "value" => "Police, probation or prison", + }, + "7" => { + "value" => "Voluntary agency", + }, + "13" => { + "value" => "Youth offending team", + }, + "17" => { + "value" => "Children’s Social Care", + }, + "16" => { + "value" => "Other", + }, + }.freeze end diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb new file mode 100644 index 000000000..5651f431f --- /dev/null +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -0,0 +1,51 @@ +class Form::Lettings::Questions::ReferralPrp < ::Form::Question + def initialize(id, hsh, page) + super + @id = "referral" + @check_answer_label = "Source of referral for letting" + @header = "What was the source of referral for this letting?" + @type = "radio" + @check_answers_card_number = 0 + @hint_text = "" + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { + "1" => { + "value" => "Internal transfer", + }, + "2" => { + "value" => "Tenant applied directly (no nomination)", + }, + "3" => { + "value" => "Nominated by a local housing authority", + }, + "8" => { + "value" => "Re-located through official housing mobility scheme", + }, + "10" => { + "value" => "Other social landlord", + }, + "9" => { + "value" => "Community learning disability team", + }, + "14" => { + "value" => "Community mental health team", + }, + "15" => { + "value" => "Health service", + }, + "12" => { + "value" => "Police, probation or prison", + }, + "7" => { + "value" => "Voluntary agency", + }, + "13" => { + "value" => "Youth offending team", + }, + "16" => { + "value" => "Other", + }, + }.freeze +end diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb new file mode 100644 index 000000000..5b286d94d --- /dev/null +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -0,0 +1,51 @@ +class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question + def initialize(id, hsh, page) + super + @id = "referral" + @check_answer_label = "Source of referral for letting" + @header = "What was the source of referral for this letting?" + @type = "radio" + @check_answers_card_number = 0 + @hint_text = "" + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { + "1" => { + "value" => "Internal transfer", + }, + "2" => { + "value" => "Tenant applied directly (no referral)", + }, + "3" => { + "value" => "Referred by local authority housing department", + }, + "8" => { + "value" => "Re-located through official housing mobility scheme", + }, + "10" => { + "value" => "Other social landlord", + }, + "9" => { + "value" => "Community learning disability team", + }, + "14" => { + "value" => "Community mental health team", + }, + "15" => { + "value" => "Health service", + }, + "12" => { + "value" => "Police, probation or prison", + }, + "7" => { + "value" => "Voluntary agency", + }, + "13" => { + "value" => "Youth offending team", + }, + "16" => { + "value" => "Other", + }, + }.freeze +end diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb new file mode 100644 index 000000000..6b9153c07 --- /dev/null +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -0,0 +1,26 @@ +class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question + def initialize(id, hsh, page) + super + @id = "referral" + @check_answer_label = "Source of referral for letting" + @header = "What was the source of referral for this letting?" + @type = "radio" + @check_answers_card_number = 0 + @hint_text = "" + @answer_options = ANSWER_OPTIONS + end + + ANSWER_OPTIONS = { "1" => { "value" => "Internal transfer" }, + "2" => { "value" => "Tenant applied directly (no referral or nomination)" }, + "3" => { "value" => "Nominated by a local housing authority" }, + "4" => { "value" => "Referred by local authority housing department" }, + "8" => { "value" => "Re-located through official housing mobility scheme" }, + "10" => { "value" => "Other social landlord" }, + "9" => { "value" => "Community learning disability team" }, + "14" => { "value" => "Community mental health team" }, + "15" => { "value" => "Health service" }, + "12" => { "value" => "Police, probation or prison" }, + "7" => { "value" => "Voluntary agency" }, + "13" => { "value" => "Youth offending team" }, + "16" => { "value" => "Other" } }.freeze +end