|
|
|
@ -1,5 +1,13 @@
|
|
|
|
|
module DerivedVariables::CaseLogVariables |
|
|
|
|
RENT_TYPE_MAPPING = { 0 => 1, 1 => 2, 2 => 2, 3 => 3, 4 => 3, 5 => 3 }.freeze |
|
|
|
|
TYPE_OF_UNIT_MAP = { |
|
|
|
|
"Self-contained flat or bedsit" => 1, |
|
|
|
|
"Self-contained flat or bedsit with common facilities" => 2, |
|
|
|
|
"Shared flat" => 3, |
|
|
|
|
"Shared house or hostel" => 4, |
|
|
|
|
"Bungalow" => 5, |
|
|
|
|
"Self-contained house" => 6, |
|
|
|
|
}.freeze |
|
|
|
|
|
|
|
|
|
def supported_housing_schemes_enabled? |
|
|
|
|
FeatureToggle.supported_housing_schemes_enabled? |
|
|
|
@ -75,15 +83,7 @@ module DerivedVariables::CaseLogVariables
|
|
|
|
|
if location |
|
|
|
|
self.la = location.county |
|
|
|
|
self.postcode_full = location.postcode |
|
|
|
|
type_of_unit_map = { |
|
|
|
|
"Self-contained flat or bedsit" => 1, |
|
|
|
|
"Self-contained flat or bedsit with common facilities" => 2, |
|
|
|
|
"Shared flat" => 3, |
|
|
|
|
"Shared house or hostel" => 4, |
|
|
|
|
"Bungalow" => 5, |
|
|
|
|
"Self-contained house" => 6, |
|
|
|
|
} |
|
|
|
|
self.unittype_sh = type_of_unit_map[location.type_of_unit] |
|
|
|
|
self.unittype_sh = TYPE_OF_UNIT_MAP[location.type_of_unit] |
|
|
|
|
self.builtype = form.questions.find { |x| x.id == "builtype" }.answer_options.select { |_key, value| value["value"] == location.type_of_building }.keys.first |
|
|
|
|
wheelchair_adaptation_map = { 1 => 1, 0 => 2 } |
|
|
|
|
self.wchair = wheelchair_adaptation_map[location.wheelchair_adaptation.to_i] |
|
|
|
|