Browse Source

feat: infer uprn_known as No if the user answers address (through "Enter address instead" route/check answers page)

CLDC-2632.2-set-uprn-known-no
natdeanlewissoftwire 1 year ago
parent
commit
fe4e01e0fd
  1. 6
      app/models/derived_variables/lettings_log_variables.rb

6
app/models/derived_variables/lettings_log_variables.rb

@ -95,6 +95,8 @@ module DerivedVariables::LettingsLogVariables
set_housingneeds_fields if housingneeds? set_housingneeds_fields if housingneeds?
self.uprn_known = 0 if address_answered?
if uprn_known&.zero? if uprn_known&.zero?
self.uprn = nil self.uprn = nil
end end
@ -310,6 +312,10 @@ private
self.county = nil self.county = nil
end end
def address_answered?
[address_line1, town_or_city].all?(&:present?)
end
def get_lar def get_lar
return 1 if rent_type == 2 return 1 if rent_type == 2
return 2 if rent_type == 1 return 2 if rent_type == 1

Loading…
Cancel
Save