Browse Source

fix typo

pull/298/head
Kat 3 years ago
parent
commit
08a25add79
  1. 2
      app/models/case_log.rb
  2. 12
      app/models/constants/case_log.rb
  3. 203
      config/forms/2021_2022.json
  4. 9
      db/migrate/20220209105333_fix_typo.rb
  5. 2
      db/schema.rb
  6. 6
      docs/api/DLUHC-CORE-Data.v1.json
  7. 2
      spec/factories/case_log.rb
  8. 2
      spec/fixtures/complete_case_log.json
  9. 4
      spec/fixtures/forms/2021_2022.json
  10. 6
      spec/models/case_log_spec.rb

2
app/models/case_log.rb

@ -49,7 +49,7 @@ class CaseLog < ApplicationRecord
scope :for_organisation, ->(org) { where(owning_organisation: org).or(where(managing_organisation: org)) }
enum status: STATUS
enum letting_in_sheltered_accomodation: SHELTERED_ACCOMODATION
enum letting_in_sheltered_accommodation: SHELTERED_ACCOMMODATION
enum ethnic: ETHNIC
enum national: NATIONAL, _suffix: true
enum ecstat1: ECSTAT, _suffix: true

12
app/models/constants/case_log.rb

@ -108,7 +108,7 @@ module Constants::CaseLog
"Private sector tenancy" => 3,
"Tied housing or rented with job" => 4,
"Supported housing" => 6,
"Sheltered accomodation" => 8,
"Sheltered accommodation" => 8,
"Residential care home" => 9,
"Living with friends or family" => 28,
"Refuge" => 21,
@ -263,10 +263,10 @@ module Constants::CaseLog
"Couldn't afford rent or mortgage - other" => 39,
"To move nearer to family, friends or school" => 16,
"To move nearer to work" => 17,
"To move to accomodation with support" => 18,
"To move to independent accomodation" => 19,
"To move to accommodation with support" => 18,
"To move to independent accommodation" => 19,
"Hate crime" => 31,
"Death of household member in last settled accomodation" => 46,
"Death of household member in last settled accommodation" => 46,
"Discharged from prison" => 44,
"Discharged from long stay hospital or similar institution" => 45,
"Other" => 20,
@ -1088,7 +1088,7 @@ module Constants::CaseLog
"completed" => 2,
}.freeze
SHELTERED_ACCOMODATION = {
SHELTERED_ACCOMMODATION = {
"Yes - sheltered housing" => 1,
"Yes - extra care housing" => 2,
"No" => 3,
@ -1120,7 +1120,7 @@ module Constants::CaseLog
NON_TEMP_ACCOMMODATION = ["Tied housing or rented with job",
"Supported housing",
"Sheltered accomodation",
"Sheltered accommodation",
"Home Office Asylum Support",
"Other"].freeze

203
config/forms/2021_2022.json

@ -1286,12 +1286,12 @@
"30": {
"value": "To move to independent accomodation"
},
"divider": {
"value": true
},
"31": {
"value": "Other"
},
"divider": {
"value": true
},
"32": {
"value": "Don’t know"
},
@ -1300,9 +1300,7 @@
}
},
"conditional_for": {
"other_reason_for_leaving_last_settled_home": [
"Other"
]
"other_reason_for_leaving_last_settled_home": ["Other"]
}
},
"other_reason_for_leaving_last_settled_home": {
@ -2313,9 +2311,7 @@
}
},
"conditional_for": {
"tenancyother": [
"Other"
]
"tenancyother": ["Other"]
}
},
"tenancyother": {
@ -2357,9 +2353,7 @@
}
},
"conditional_for": {
"tenancyother": [
"Other"
]
"tenancyother": ["Other"]
}
},
"tenancyother": {
@ -2397,11 +2391,11 @@
}
]
},
"letting_in_sheltered_accomodation": {
"letting_in_sheltered_accommodation": {
"header": "",
"description": "",
"questions": {
"letting_in_sheltered_accomodation": {
"letting_in_sheltered_accommodation": {
"check_answer_label": "Is this letting in sheltered accommodation?",
"header": "Is this letting in sheltered accommodation?",
"hint_text": "",
@ -2459,9 +2453,7 @@
}
},
"conditional_for": {
"property_postcode": [
"Yes"
]
"property_postcode": ["Yes"]
},
"hidden_in_check_answers": true
},
@ -3192,9 +3184,7 @@
}
},
"conditional_for": {
"mrcdate": [
"Yes"
]
"mrcdate": ["Yes"]
}
},
"mrcdate": {
@ -3271,9 +3261,18 @@
"width": 5,
"prefix": "£",
"suffix": [
{ "label": "every week", "depends_on" : { "incfreq": "Weekly" } },
{ "label": "every month", "depends_on" : { "incfreq": "Monthly" } },
{ "label": "every month", "depends_on" : { "incfreq": "Yearly" } }
{
"label": "every week",
"depends_on": { "incfreq": "Weekly" }
},
{
"label": "every month",
"depends_on": { "incfreq": "Monthly" }
},
{
"label": "every month",
"depends_on": { "incfreq": "Yearly" }
}
]
},
"incfreq": {
@ -3464,9 +3463,7 @@
}
},
"conditional_for": {
"chcharge": [
"Yes"
]
"chcharge": ["Yes"]
}
},
"chcharge": {
@ -3560,9 +3557,7 @@
}
},
"conditional_for": {
"chcharge": [
"Yes"
]
"chcharge": ["Yes"]
}
},
"chcharge": {
@ -3606,9 +3601,7 @@
}
},
"conditional_for": {
"chcharge": [
"Yes"
]
"chcharge": ["Yes"]
}
},
"chcharge": {
@ -3652,9 +3645,7 @@
}
},
"conditional_for": {
"chcharge": [
"Yes"
]
"chcharge": ["Yes"]
}
},
"chcharge": {
@ -3694,12 +3685,7 @@
"width": 5,
"prefix": "£",
"suffix": " every week",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3713,12 +3699,7 @@
"width": 5,
"prefix": "£",
"suffix": " every week",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3732,12 +3713,7 @@
"width": 5,
"prefix": "£",
"suffix": " every week",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3751,12 +3727,7 @@
"width": 5,
"prefix": "£",
"suffix": " every week",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3772,12 +3743,7 @@
"suffix": " every week",
"readonly": true,
"requires_js": true,
"fields_added": [
"brent",
"scharge",
"pscharge",
"supcharg"
]
"fields_added": ["brent", "scharge", "pscharge", "supcharg"]
}
},
"depends_on": [
@ -3917,12 +3883,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 2 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3936,12 +3897,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 2 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3955,12 +3911,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 2 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3974,12 +3925,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 2 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -3995,12 +3941,7 @@
"suffix": " every 2 weeks",
"readonly": true,
"requires_js": true,
"fields_added": [
"brent",
"scharge",
"pscharge",
"supcharg"
]
"fields_added": ["brent", "scharge", "pscharge", "supcharg"]
}
},
"depends_on": [
@ -4040,12 +3981,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 4 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4059,12 +3995,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 4 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4078,12 +4009,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 4 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4097,12 +4023,7 @@
"width": 5,
"prefix": "£",
"suffix": " every 4 weeks",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4118,12 +4039,7 @@
"suffix": " every 4 weeks",
"readonly": true,
"requires_js": true,
"fields_added": [
"brent",
"scharge",
"pscharge",
"supcharg"
]
"fields_added": ["brent", "scharge", "pscharge", "supcharg"]
}
},
"depends_on": [
@ -4163,12 +4079,7 @@
"width": 5,
"prefix": "£",
"suffix": " every month",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4182,12 +4093,7 @@
"width": 5,
"prefix": "£",
"suffix": " every month",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4201,12 +4107,7 @@
"width": 5,
"prefix": "£",
"suffix": " every month",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4220,12 +4121,7 @@
"width": 5,
"prefix": "£",
"suffix": " every month",
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"result-field": "tcharge",
"hidden_in_check_answers": true
},
@ -4241,12 +4137,7 @@
"suffix": " every month",
"readonly": true,
"requires_js": true,
"fields_added": [
"brent",
"scharge",
"pscharge",
"supcharg"
]
"fields_added": ["brent", "scharge", "pscharge", "supcharg"]
}
},
"depends_on": [
@ -4366,4 +4257,4 @@
}
}
}
}
}

9
db/migrate/20220209105333_fix_typo.rb

@ -0,0 +1,9 @@
class FixTypo < ActiveRecord::Migration[7.0]
def up
rename_column :case_logs, :letting_in_sheltered_accomodation, :letting_in_sheltered_accommodation
end
def down
rename_column :case_logs, :letting_in_sheltered_accommodation, :letting_in_sheltered_accomodation
end
end

2
db/schema.rb

@ -176,7 +176,7 @@ ActiveRecord::Schema[7.0].define(version: 202202071123100) do
t.string "has_benefits"
t.integer "nocharge"
t.integer "is_carehome"
t.integer "letting_in_sheltered_accomodation"
t.integer "letting_in_sheltered_accommodation"
t.integer "household_charge"
t.integer "referral"
t.decimal "brent", precision: 10, scale: 2

6
docs/api/DLUHC-CORE-Data.v1.json

@ -754,10 +754,10 @@
"Couldn’t afford rent or mortgage - other",
"To move nearer to family, friends or school",
"To move nearer to work",
"To move to accomodation with support",
"To move to independent accomodation",
"To move to accommodation with support",
"To move to independent accommodation",
"Hate crime",
"Death of household member in last settled accomodation",
"Death of household member in last settled accommodation",
"Discharged from prison",
"Discharged from long stay hospital or similar institution",
"Other",

2
spec/factories/case_log.rb

@ -144,7 +144,7 @@ FactoryBot.define do
has_benefits { "Yes" }
is_carehome { "No" }
chcharge { 7 }
letting_in_sheltered_accomodation { "No" }
letting_in_sheltered_accommodation { "No" }
la_known { "Yes" }
declaration { "Yes" }
end

2
spec/fixtures/complete_case_log.json vendored

@ -143,7 +143,7 @@
"household_charge": "Yes",
"is_carehome": "Yes",
"chcharge": "6",
"letting_in_sheltered_accomodation": "No",
"letting_in_sheltered_accommodation": "No",
"declaration": "Yes"
}
}

4
spec/fixtures/forms/2021_2022.json vendored

@ -753,7 +753,7 @@
"property_postcode": {
"questions": {
"property_postcode": {
"check_answer_label": "Postcode of previous accomodation if the household has moved from settled accommodation",
"check_answer_label": "Postcode of previous accommodation if the household has moved from settled accommodation",
"header": "Postcode for the previous accommodation",
"hint_text": "If the household has moved from settled accommodation immediately prior to being re-housed",
"type": "text",
@ -761,7 +761,7 @@
"conditional_for": { "fake_key": "fake_condition" }
},
"previous_postcode": {
"check_answer_label": "Postcode of previous accomodation if the household has moved from settled accommodation",
"check_answer_label": "Postcode of previous accommodation if the household has moved from settled accommodation",
"header": "Postcode for the previous accommodation",
"hint_text": "If the household has moved from settled accommodation immediately prior to being re-housed",
"type": "text",

6
spec/models/case_log_spec.rb

@ -892,15 +892,15 @@ RSpec.describe CaseLog do
}.to raise_error(ActiveRecord::RecordInvalid)
end
it "cannot be temp accomodation if previous tenancy was non temp" do
it "cannot be temp accommodation if previous tenancy was non temp" do
check_rsnvac_validation("Tied housing or rented with job")
check_rsnvac_validation("Supported housing")
check_rsnvac_validation("Sheltered accomodation")
check_rsnvac_validation("Sheltered accommodation")
check_rsnvac_validation("Home Office Asylum Support")
check_rsnvac_validation("Other")
end
it "cannot be temp accomodation if source of letting referral " do
it "cannot be temp accommodation if source of letting referral " do
check_rsnvac_referral_validation("Re-located through official housing mobility scheme")
check_rsnvac_referral_validation("Other social landlord")
check_rsnvac_referral_validation("Police, probation or prison")

Loading…
Cancel
Save