|
|
@ -132,7 +132,7 @@ class CaseLog < ApplicationRecord |
|
|
|
enum la_known: POLAR, _suffix: true |
|
|
|
enum la_known: POLAR, _suffix: true |
|
|
|
enum net_income_known: NET_INCOME_KNOWN, _suffix: true |
|
|
|
enum net_income_known: NET_INCOME_KNOWN, _suffix: true |
|
|
|
|
|
|
|
|
|
|
|
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at renttype lettype is_la_inferred totchild totelder totadult].freeze |
|
|
|
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at renttype lettype is_la_inferred totchild totelder totadult incfreq].freeze |
|
|
|
OPTIONAL_FIELDS = %w[postcode_known |
|
|
|
OPTIONAL_FIELDS = %w[postcode_known |
|
|
|
la_known |
|
|
|
la_known |
|
|
|
first_time_property_let_as_social_housing].freeze |
|
|
|
first_time_property_let_as_social_housing].freeze |
|
|
@ -215,7 +215,16 @@ private |
|
|
|
self.month = startdate.month |
|
|
|
self.month = startdate.month |
|
|
|
self.year = startdate.year |
|
|
|
self.year = startdate.year |
|
|
|
end |
|
|
|
end |
|
|
|
self.incref = 1 if net_income_known == "Tenant prefers not to say" |
|
|
|
case net_income_known |
|
|
|
|
|
|
|
when "Yes – the household has a weekly income" |
|
|
|
|
|
|
|
self.incfreq = "Weekly" |
|
|
|
|
|
|
|
when "Yes – the household has a monthly income" |
|
|
|
|
|
|
|
self.incfreq = "Monthly" |
|
|
|
|
|
|
|
when "Yes – the household has a yearly income" |
|
|
|
|
|
|
|
self.incfreq = "Yearly" |
|
|
|
|
|
|
|
when "Tenant prefers not to say" |
|
|
|
|
|
|
|
self.incref = 1 |
|
|
|
|
|
|
|
end |
|
|
|
self.hhmemb = other_hhmemb + 1 if other_hhmemb.present? |
|
|
|
self.hhmemb = other_hhmemb + 1 if other_hhmemb.present? |
|
|
|
self.renttype = RENT_TYPE_MAPPING[rent_type] |
|
|
|
self.renttype = RENT_TYPE_MAPPING[rent_type] |
|
|
|
self.lettype = "#{renttype} #{needstype} #{owning_organisation['Org type']}" if renttype.present? && needstype.present? && owning_organisation["Org type"].present? |
|
|
|
self.lettype = "#{renttype} #{needstype} #{owning_organisation['Org type']}" if renttype.present? && needstype.present? && owning_organisation["Org type"].present? |
|
|
@ -318,7 +327,6 @@ private |
|
|
|
|
|
|
|
|
|
|
|
if net_income_known == "Tenant prefers not to say" |
|
|
|
if net_income_known == "Tenant prefers not to say" |
|
|
|
dynamically_not_required << "earnings" |
|
|
|
dynamically_not_required << "earnings" |
|
|
|
dynamically_not_required << "incfreq" |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
dynamically_not_required << "incref" |
|
|
|
dynamically_not_required << "incref" |
|
|
|
end |
|
|
|
end |
|
|
|