Browse Source

Add carehome questions and move the remaining rent questions to income and benefits section

pull/213/head
Kat 4 years ago
parent
commit
5925ee5686
  1. 87
      config/forms/2021_2022.json
  2. 8
      db/migrate/20220111140400_add_care_home_charge_fields.rb
  3. 4
      db/schema.rb
  4. 2
      spec/factories/case_log.rb
  5. 4
      spec/fixtures/complete_case_log.json

87
config/forms/2021_2022.json

@ -1988,35 +1988,37 @@
},{
"nocharge": null
}]
}
}
},
"rent": {
"label": "Rent",
"depends_on": [{ "about_this_log": "completed" }],
"pages": {
"rent": {
},
"care_home": {
"header": "",
"description": "",
"questions": {
"period": {
"check_answer_label": "Rent Period",
"header": "Which period are rent and other charges due?",
"is_carehome": {
"check_answer_label": "Is this accommodation a care home?",
"header": "Is this accommodation a care home?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Weekly for 52 weeks",
"1": "Fortnightly",
"2": "Four-weekly",
"3": "Calendar monthly",
"4": "Weekly for 50 weeks",
"5": "Weekly for 49 weeks",
"6": "Weekly for 48 weeks",
"7": "Weekly for 47 weeks",
"8": "Weekly for 46 weeks",
"9": "Weekly for 53 weeks"
"1": "Yes",
"0": "No"
},
"conditional_for": {
"chcharge": ["Yes"]
}
},
"chcharge": {
"check_answer_label": "How much does the household pay every [PERIOD]?",
"header": "How much does the household pay every [PERIOD]?",
"hint_text": "",
"type": "numeric",
"width": 5
}
}
},
"rent": {
"header": "",
"description": "",
"questions": {
"brent": {
"check_answer_label": "Basic Rent",
"header": "What is the basic rent?",
@ -2076,22 +2078,30 @@
"suffix": "every week",
"readonly": true,
"requires_js": true
},
}
}
},
"rent_shortfall":{
"header": "",
"description": "",
"questions": {
"hbrentshortfall": {
"check_answer_label": "After housing benefit and/or housing element of UC payment is received, will there be an outstanding amount for basic rent and/or benefit eligible charges?",
"header": "After housing benefit and/or housing element of UC payment is received, will there be an outstanding amount for basic rent and/or benefit eligible charges?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No",
"divider": true,
"2": "Don’t know"
},
"conditional_for": {
"tshortfall": ["Yes"]
}
},
"check_answer_label": "After housing benefit and/or housing element of UC payment is received, will there be an outstanding amount for basic rent and/or benefit eligible charges?",
"header": "After housing benefit and/or housing element of UC payment is received, will there be an outstanding amount for basic rent and/or benefit eligible charges?",
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
}
}
},
"depends_on": [{"has_benefits": "yes"}]
},
"rent_shortfall_amount":{
"header": "",
"description": "",
"questions": {
"tshortfall": {
"check_answer_label": "Outstanding amount",
"header": "What do you expect the amount to be?",
@ -2100,7 +2110,10 @@
"min": 0,
"step": 1
}
}
},
"depends_on": [{"has_benefits": "yes",
"hbrentshortfall": "Yes"
}]
}
}
}

8
db/migrate/20220111140400_add_care_home_charge_fields.rb

@ -0,0 +1,8 @@
class AddCareHomeChargeFields < ActiveRecord::Migration[7.0]
def change
change_table :case_logs, bulk: true do |t|
t.column :is_carehome, :integer
t.column :chcharge, :decimal
end
end
end

4
db/schema.rb

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_01_10_161957) do
ActiveRecord::Schema.define(version: 2022_01_11_140400) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -180,6 +180,8 @@ ActiveRecord::Schema.define(version: 2022_01_10_161957) do
t.integer "net_income_known"
t.string "has_benefits"
t.integer "nocharge"
t.integer "is_carehome"
t.decimal "chcharge"
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 ["owning_organisation_id"], name: "index_case_logs_on_owning_organisation_id"

2
spec/factories/case_log.rb

@ -149,6 +149,8 @@ FactoryBot.define do
builtype { 1 }
unitletas { 2 }
nocharge { "No" }
is_carehome { "No" }
chcharge { 7 }
end
created_at { Time.zone.now }
updated_at { Time.zone.now }

4
spec/fixtures/complete_case_log.json vendored

@ -145,6 +145,8 @@
"void_or_renewal_date": "05/05/2020",
"tenant_same_property_renewal": "Yes",
"new_build_handover_date": "01/01/2019",
"nocharge": "No"
"nocharge": "No",
"is_carehome": "Yes",
"chcharge": "6"
}
}

Loading…
Cancel
Save