Browse Source

Add referral question/field

pull/242/head
Kat 3 years ago
parent
commit
4c321148d3
  1. 1
      app/models/case_log.rb
  2. 16
      app/models/constants/case_log.rb
  3. 27
      config/forms/2021_2022.json
  4. 7
      db/migrate/20220124121642_add_referral_field.rb
  5. 19
      db/schema.rb

1
app/models/case_log.rb

@ -139,6 +139,7 @@ class CaseLog < ApplicationRecord
enum household_charge: POLAR, _suffix: true enum household_charge: POLAR, _suffix: true
enum is_carehome: POLAR, _suffix: true enum is_carehome: POLAR, _suffix: true
enum nocharge: POLAR, _suffix: true enum nocharge: POLAR, _suffix: true
enum referral: REFERRAL, _suffix: true
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze
OPTIONAL_FIELDS = %w[postcode_known la_known first_time_property_let_as_social_housing].freeze OPTIONAL_FIELDS = %w[postcode_known la_known first_time_property_let_as_social_housing].freeze

16
app/models/constants/case_log.rb

@ -1096,6 +1096,22 @@ module Constants::CaseLog
"Don’t know" => 4, "Don’t know" => 4,
}.freeze }.freeze
REFERRAL = {
"Internal transfer" => 1,
"Tenant applied directly (no referral or nomination)" => 2,
"Private registered provider (PRP) lettings only - nominated by a local housing authority" => 3,
"Private registered provider (PRP) supported lettings only - referred by local authority housing department" => 4,
"Re-located through official housing mobility scheme" => 8,
"Other social landlord" => 10,
"Community learning disability team" => 9,
"Police, probation or prison" => 12,
"Youth offending team" => 13,
"Community mental health team" => 14,
"Health service" => 15,
"Voluntary agency" => 7,
"Other" => 16,
}.freeze
NON_TEMP_ACCOMMODATION = ["Tied housing or rented with job", NON_TEMP_ACCOMMODATION = ["Tied housing or rented with job",
"Supported housing", "Supported housing",
"Sheltered accomodation", "Sheltered accomodation",

27
config/forms/2021_2022.json

@ -3245,6 +3245,33 @@
} }
} }
} }
},
"referral": {
"header": "",
"description": "",
"questions": {
"referral": {
"check_answer_label": "Source of referral for letting",
"header": "What was the source of referral for this letting?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Internal transfer",
"1": "Tenant applied directly (no referral or nomination)",
"2": "Private registered provider (PRP) lettings only - nominated by a local housing authority",
"3": "Private registered provider (PRP) supported lettings only - referred by local authority housing department",
"4": "Re-located through official housing mobility scheme",
"5": "Other social landlord",
"6": "Community learning disability team",
"7": "Police, probation or prison",
"8": "Youth offending team",
"9": "Community mental health team",
"10": "Health service",
"11": "Voluntary agency",
"12": "Other"
}
}
}
} }
} }
} }

7
db/migrate/20220124121642_add_referral_field.rb

@ -0,0 +1,7 @@
class AddReferralField < ActiveRecord::Migration[7.0]
def change
change_table :case_logs, bulk: true do |t|
t.column :referral, :integer
end
end
end

19
db/schema.rb

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_01_14_105351) do ActiveRecord::Schema.define(version: 2022_01_24_121642) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -84,15 +84,9 @@ ActiveRecord::Schema.define(version: 2022_01_14_105351) do
t.integer "beds" t.integer "beds"
t.integer "offered" t.integer "offered"
t.integer "wchair" t.integer "wchair"
t.integer "earnings"
t.integer "incfreq" t.integer "incfreq"
t.integer "benefits" t.integer "benefits"
t.integer "period" t.integer "period"
t.integer "brent"
t.integer "scharge"
t.integer "pscharge"
t.integer "supcharg"
t.integer "tcharge"
t.integer "layear" t.integer "layear"
t.integer "lawaitlist" t.integer "lawaitlist"
t.string "property_postcode" t.string "property_postcode"
@ -143,7 +137,6 @@ ActiveRecord::Schema.define(version: 2022_01_14_105351) do
t.string "prevloc" t.string "prevloc"
t.integer "hb" t.integer "hb"
t.integer "hbrentshortfall" t.integer "hbrentshortfall"
t.integer "tshortfall"
t.string "postcode" t.string "postcode"
t.string "postcod2" t.string "postcod2"
t.string "ppostc1" t.string "ppostc1"
@ -181,9 +174,17 @@ ActiveRecord::Schema.define(version: 2022_01_14_105351) do
t.string "has_benefits" t.string "has_benefits"
t.integer "nocharge" t.integer "nocharge"
t.integer "is_carehome" t.integer "is_carehome"
t.decimal "chcharge"
t.integer "letting_in_sheltered_accomodation" t.integer "letting_in_sheltered_accomodation"
t.integer "household_charge" t.integer "household_charge"
t.integer "earnings"
t.integer "brent"
t.integer "scharge"
t.integer "pscharge"
t.integer "supcharg"
t.integer "tcharge"
t.integer "tshortfall"
t.integer "chcharge"
t.integer "referral"
t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at"
t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id"
t.index ["owning_organisation_id"], name: "index_case_logs_on_owning_organisation_id" t.index ["owning_organisation_id"], name: "index_case_logs_on_owning_organisation_id"

Loading…
Cancel
Save