Browse Source

remove letting_in_sheltered_accomodation field (#577)

* remove letting_in_sheltered_accomodation field

This field is now duplicated by the shelteredaccom field

* lint fixes

* fix all failing specs
pull/579/head
Dushan 3 years ago committed by GitHub
parent
commit
804a6bd00c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app/models/form/question.rb
  2. 2
      config/forms/2021_2022.json
  3. 2
      config/forms/2022_2023.json
  4. 5
      db/migrate/20220513123456_remove_duplicate_sheltered_accomodation_column.rb
  5. 3
      db/schema.rb
  6. 2
      docs/api/DLUHC-CORE-Data.v1.json
  7. 2
      spec/factories/case_log.rb
  8. 2
      spec/fixtures/complete_case_log.json
  9. 3
      spec/fixtures/exports/case_logs.xml

8
app/models/form/question.rb

@ -241,7 +241,7 @@ private
wchair: [1], wchair: [1],
majorrepairs: [1], majorrepairs: [1],
startertenancy: [0], startertenancy: [0],
letting_in_sheltered_accommodation: [0, 1], shelteredaccom: [0, 1],
armedforces: [1, 4, 5], armedforces: [1, 4, 5],
leftreg: [0], leftreg: [0],
reservist: [0], reservist: [0],
@ -265,7 +265,7 @@ private
wchair: [0], wchair: [0],
majorrepairs: [0], majorrepairs: [0],
startertenancy: [1], startertenancy: [1],
letting_in_sheltered_accommodation: [2], shelteredaccom: [2],
armedforces: [2], armedforces: [2],
leftreg: [1], leftreg: [1],
reservist: [1], reservist: [1],
@ -281,7 +281,7 @@ private
}.freeze }.freeze
RADIO_DONT_KNOW_VALUE = { RADIO_DONT_KNOW_VALUE = {
letting_in_sheltered_accommodation: [3], shelteredaccom: [3],
underoccupation_benefitcap: [3], underoccupation_benefitcap: [3],
reasonpref: [3], reasonpref: [3],
hbrentshortfall: [3], hbrentshortfall: [3],
@ -317,7 +317,7 @@ private
ecstat6: [10], ecstat6: [10],
ecstat7: [10], ecstat7: [10],
ecstat8: [10], ecstat8: [10],
letting_in_sheltered_accommodation: [3], shelteredaccom: [3],
armedforces: [3], armedforces: [3],
leftreg: [3], leftreg: [3],
reservist: [2], reservist: [2],

2
config/forms/2021_2022.json

@ -1076,7 +1076,7 @@
} }
] ]
}, },
"letting_in_sheltered_accommodation": { "shelteredaccom": {
"header": "", "header": "",
"description": "", "description": "",
"questions": { "questions": {

2
config/forms/2022_2023.json

@ -1102,7 +1102,7 @@
} }
] ]
}, },
"letting_in_sheltered_accommodation": { "shelteredaccom": {
"header": "", "header": "",
"description": "", "description": "",
"questions": { "questions": {

5
db/migrate/20220513123456_remove_duplicate_sheltered_accomodation_column.rb

@ -0,0 +1,5 @@
class RemoveDuplicateShelteredAccomodationColumn < ActiveRecord::Migration[7.0]
def change
remove_column :case_logs, :letting_in_sheltered_accommodation, :integer
end
end

3
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[7.0].define(version: 2022_05_11_114334) do ActiveRecord::Schema[7.0].define(version: 2022_05_13_123456) 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"
@ -162,7 +162,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_05_11_114334) do
t.integer "net_income_known" t.integer "net_income_known"
t.integer "nocharge" t.integer "nocharge"
t.integer "is_carehome" t.integer "is_carehome"
t.integer "letting_in_sheltered_accommodation"
t.integer "household_charge" t.integer "household_charge"
t.integer "referral" t.integer "referral"
t.decimal "brent", precision: 10, scale: 2 t.decimal "brent", precision: 10, scale: 2

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

@ -410,7 +410,7 @@
"household_charge": 1, "household_charge": 1,
"is_carehome": 1, "is_carehome": 1,
"chcharge": 6, "chcharge": 6,
"letting_in_sheltered_accommodation": 0, "shelteredaccom": 0,
"declaration": 1 "declaration": 1
} }
} }

2
spec/factories/case_log.rb

@ -129,7 +129,7 @@ FactoryBot.define do
unitletas { 2 } unitletas { 2 }
has_benefits { 1 } has_benefits { 1 }
is_carehome { 0 } is_carehome { 0 }
letting_in_sheltered_accommodation { 0 } shelteredaccom { 0 }
declaration { 1 } declaration { 1 }
end end
created_at { Time.utc(2022, 2, 8, 16, 52, 15) } created_at { Time.utc(2022, 2, 8, 16, 52, 15) }

2
spec/fixtures/complete_case_log.json vendored

@ -132,7 +132,7 @@
"has_benefits": 1, "has_benefits": 1,
"household_charge": 0, "household_charge": 0,
"is_carehome": 1, "is_carehome": 1,
"letting_in_sheltered_accommodation": 0, "shelteredaccom": 0,
"declaration": 1, "declaration": 1,
"referral": 1 "referral": 1
} }

3
spec/fixtures/exports/case_logs.xml vendored

@ -120,7 +120,6 @@
<net_income_known>1</net_income_known> <net_income_known>1</net_income_known>
<nocharge>0</nocharge> <nocharge>0</nocharge>
<is_carehome>0</is_carehome> <is_carehome>0</is_carehome>
<letting_in_sheltered_accommodation>0</letting_in_sheltered_accommodation>
<household_charge/> <household_charge/>
<referral/> <referral/>
<brent>200.0</brent> <brent>200.0</brent>
@ -165,7 +164,7 @@
<created_by_id>{created_by_id}</created_by_id> <created_by_id>{created_by_id}</created_by_id>
<illness_type_0/> <illness_type_0/>
<tshortfall_known>0</tshortfall_known> <tshortfall_known>0</tshortfall_known>
<shelteredaccom/> <shelteredaccom>0</shelteredaccom>
<retirement_value_check/> <retirement_value_check/>
<providertype>1</providertype> <providertype>1</providertype>
</form> </form>

Loading…
Cancel
Save