Browse Source

Backfill referral questions

pull/1254/head
Kat 3 years ago
parent
commit
b2f00a2286
  1. 2
      app/models/form/lettings/pages/referral_prp.rb
  2. 2
      app/models/form/lettings/pages/referral_supported_housing.rb
  3. 2
      app/models/form/lettings/pages/referral_supported_housing_prp.rb
  4. 39
      app/models/form/lettings/questions/referral.rb
  5. 51
      app/models/form/lettings/questions/referral_prp.rb
  6. 51
      app/models/form/lettings/questions/referral_supported_housing.rb
  7. 26
      app/models/form/lettings/questions/referral_supported_housing_prp.rb

2
app/models/form/lettings/pages/referral_prp.rb

@ -8,6 +8,6 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page
end end
def questions def questions
@questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] @questions ||= [Form::Lettings::Questions::ReferralPrp.new(nil, nil, self)]
end end
end end

2
app/models/form/lettings/pages/referral_supported_housing.rb

@ -8,6 +8,6 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
end end
def questions def questions
@questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] @questions ||= [Form::Lettings::Questions::ReferralSupportedHousing.new(nil, nil, self)]
end end
end end

2
app/models/form/lettings/pages/referral_supported_housing_prp.rb

@ -8,6 +8,6 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
end end
def questions def questions
@questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] @questions ||= [Form::Lettings::Questions::ReferralSupportedHousingPrp.new(nil, nil, self)]
end end
end end

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

@ -10,5 +10,42 @@ class Form::Lettings::Questions::Referral < ::Form::Question
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
end 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 end

51
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

51
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

26
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
Loading…
Cancel
Save