Browse Source

Update leftreg values

pull/1475/head
Kat 3 years ago
parent
commit
78d2ec98ff
  1. 6
      app/models/form/lettings/questions/leftreg.rb
  2. 4
      app/models/form/question.rb
  3. 11
      app/services/bulk_upload/lettings/year2022/row_parser.rb
  4. 11
      app/services/bulk_upload/lettings/year2023/row_parser.rb
  5. 6
      config/forms/2022_2023.json
  6. 2
      spec/factories/lettings_log.rb

6
app/models/form/lettings/questions/leftreg.rb

@ -12,9 +12,9 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question
end
ANSWER_OPTIONS = {
"0" => { "value" => "Yes" },
"1" => { "value" => "No – they left up to and including 5 years ago" },
"2" => { "value" => "No – they left more than 5 years ago" },
"6" => { "value" => "Yes" },
"4" => { "value" => "No – they left up to and including 5 years ago" },
"5" => { "value" => "No – they left more than 5 years ago" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
}.freeze

4
app/models/form/question.rb

@ -338,7 +338,7 @@ private
startertenancy: [0],
sheltered: [0, 1],
armedforces: [1, 4, 5],
leftreg: [0],
leftreg: [6],
reservist: [1],
preg_occ: [1],
illness: [1],
@ -362,7 +362,7 @@ private
startertenancy: [1],
sheltered: [2],
armedforces: [2],
leftreg: [1],
leftreg: [4],
reservist: [2],
preg_occ: [2],
illness: [2],

11
app/services/bulk_upload/lettings/year2022/row_parser.rb

@ -1078,16 +1078,7 @@ private
end
def leftreg
case field_114
when 3
3
when 4
1
when 5
2
when 6
0
end
field_114
end
def homeless

11
app/services/bulk_upload/lettings/year2023/row_parser.rb

@ -1110,16 +1110,7 @@ private
end
def leftreg
case field_80
when 3
3
when 4
1
when 5
2
when 6
0
end
field_80
end
def housingneeds

6
config/forms/2022_2023.json

@ -5722,13 +5722,13 @@
"type": "radio",
"check_answer_label": "Person still serving in UK armed forces",
"answer_options": {
"0": {
"6": {
"value": "Yes"
},
"1": {
"4": {
"value": "No – they left up to and including 5 years ago"
},
"2": {
"5": {
"value": "No – they left more than 5 years ago"
},
"divider": {

2
spec/factories/lettings_log.rb

@ -55,7 +55,7 @@ FactoryBot.define do
ecstat2 { 6 }
homeless { 1 }
underoccupation_benefitcap { 0 }
leftreg { 1 }
leftreg { 4 }
reservist { 1 }
illness { 1 }
preg_occ { 2 }

Loading…
Cancel
Save