|
|
|
@ -109,8 +109,9 @@ class CaseLog < ApplicationRecord
|
|
|
|
|
enum unitletas: DbEnums.unitletas, _suffix: true |
|
|
|
|
enum builtype: DbEnums.builtype, _suffix: true |
|
|
|
|
enum incref: DbEnums.polar, _suffix: true |
|
|
|
|
enum renttype: DbEnums.renttype, _suffix: true |
|
|
|
|
|
|
|
|
|
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze |
|
|
|
|
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at renttype].freeze |
|
|
|
|
OPTIONAL_FIELDS = %w[do_you_know_the_postcode |
|
|
|
|
do_you_know_the_local_authority |
|
|
|
|
first_time_property_let_as_social_housing].freeze |
|
|
|
@ -202,6 +203,18 @@ class CaseLog < ApplicationRecord
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def renttype |
|
|
|
|
rent_type_mapping = { |
|
|
|
|
"Social Rent" => "Social Rent", |
|
|
|
|
"Affordable Rent" => "Affordable Rent", |
|
|
|
|
"London Affordable Rent" => "Affordable Rent", |
|
|
|
|
"Rent To Buy" => "Intermediate Rent", |
|
|
|
|
"London Living Rent" => "Intermediate Rent", |
|
|
|
|
"Other Intermediate Rent Product" => "Intermediate Rent", |
|
|
|
|
} |
|
|
|
|
rent_type_mapping[rent_type] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
private |
|
|
|
|
|
|
|
|
|
def update_status! |
|
|
|
|