Browse Source

feat: add accessible_register option and hint text for 2024

pull/2187/head
natdeanlewissoftwire 2 years ago committed by Kat
parent
commit
83ed5e85a9
  1. 28
      app/models/form/lettings/questions/letting_allocation.rb
  2. 5
      db/migrate/20240129161037_add_accessible_register_to_lettings_logs.rb
  3. 3
      db/schema.rb

28
app/models/form/lettings/questions/letting_allocation.rb

@ -7,15 +7,27 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
@type = "checkbox"
@check_answers_card_number = 0
@hint_text = "Select all that apply."
@answer_options = ANSWER_OPTIONS
@question_number = 84
end
ANSWER_OPTIONS = {
"cbl" => { "value" => "Choice-based lettings (CBL)" },
"cap" => { "value" => "Common Allocation Policy (CAP)" },
"chr" => { "value" => "Common housing register (CHR)" },
"divider" => { "value" => true },
"letting_allocation_unknown" => { "value" => "None of these allocation systems" },
}.freeze
def answer_options
if form.start_year_after_2024?
{
"cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." },
"cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." },
"chr" => { "value" => "Common housing register (CHR)", "hint" => "Where a single waiting list is used by a group of housing providers to receive and process housing applications. Providers may use different approaches to determine priority." },
"accessible_register" => { "value" => "Accessible housing register", "hint" => "Where the ‘access category’ or another descriptor of whether an available vacant property meets a range of access needs is displayed to applicants during the allocations process." },
"divider" => { "value" => true },
"letting_allocation_unknown" => { "value" => "None of these allocation systems" },
}.freeze
else
{
"cbl" => { "value" => "Choice-based lettings (CBL)" },
"cap" => { "value" => "Common Allocation Policy (CAP)" },
"chr" => { "value" => "Common housing register (CHR)" },
"divider" => { "value" => true },
"letting_allocation_unknown" => { "value" => "None of these allocation systems" },
}.freeze
end
end
end

5
db/migrate/20240129161037_add_accessible_register_to_lettings_logs.rb

@ -0,0 +1,5 @@
class AddAccessibleRegisterToLettingsLogs < ActiveRecord::Migration[7.0]
def change
add_column :lettings_logs, :accessible_register, :integer
end
end

3
db/schema.rb

@ -305,6 +305,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_01_30_084707) do
t.integer "duplicate_set_id"
t.integer "nationality_all"
t.integer "nationality_all_group"
t.integer "accessible_register"
t.index ["bulk_upload_id"], name: "index_lettings_logs_on_bulk_upload_id"
t.index ["created_by_id"], name: "index_lettings_logs_on_created_by_id"
t.index ["location_id"], name: "index_lettings_logs_on_location_id"
@ -466,8 +467,6 @@ ActiveRecord::Schema[7.0].define(version: 2024_01_30_084707) do
t.string "reader_type", null: false
t.bigint "reader_id"
t.datetime "timestamp", precision: nil, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["readable_type", "readable_id"], name: "index_read_marks_on_readable_type_and_readable_id"
t.index ["reader_id", "reader_type", "readable_type", "readable_id"], name: "read_marks_reader_readable_index", unique: true
t.index ["reader_type", "reader_id"], name: "index_read_marks_on_reader_type_and_reader_id"

Loading…
Cancel
Save