|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
module Csv |
|
|
|
|
class CaseLogCsvService |
|
|
|
|
CSV_FIELDS_TO_OMIT = %w[hhmemb net_income_value_check sale_or_letting first_time_property_let_as_social_housing renttype needstype postcode_known is_la_inferred totchild totelder totadult net_income_known is_carehome previous_la_known is_previous_la_inferred age1_known age2_known age3_known age4_known age5_known age6_known age7_known age8_known letting_allocation_unknown details_known_2 details_known_3 details_known_4 details_known_5 details_known_6 details_known_7 details_known_8 rent_type wrent wscharge wpschrge wsupchrg wtcharge wtshortfall rent_value_check old_form_id old_id retirement_value_check tshortfall_known pregnancy_value_check hhtype new_old vacdays].freeze |
|
|
|
|
CSV_FIELDS_TO_OMIT = %w[hhmemb net_income_value_check sale_or_letting first_time_property_let_as_social_housing renttype needstype postcode_known is_la_inferred totchild totelder totadult net_income_known is_carehome previous_la_known is_previous_la_inferred age1_known age2_known age3_known age4_known age5_known age6_known age7_known age8_known letting_allocation_unknown details_known_2 details_known_3 details_known_4 details_known_5 details_known_6 details_known_7 details_known_8 rent_type wrent wscharge wpschrge wsupchrg wtcharge wtshortfall rent_value_check old_form_id old_id retirement_value_check tshortfall_known pregnancy_value_check hhtype new_old vacdays scheme_id location_id].freeze |
|
|
|
|
|
|
|
|
|
def initialize(user) |
|
|
|
|
@user = user |
|
|
|
@ -29,7 +29,9 @@ module Csv
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def set_csv_attributes |
|
|
|
|
@attributes = CaseLog.attribute_names + %w[unittype_sh] |
|
|
|
|
scheme_attributes = %w[scheme_code scheme_service_name scheme_sensitive scheme_type scheme_registered_under_care_act scheme_owning_organisation_name scheme_managing_organisation_name scheme_primary_client_group scheme_has_other_client_group scheme_secondary_client_group scheme_support_type scheme_intended_stay scheme_created_at] |
|
|
|
|
location_attributes = %w[location_code location_postcode location_name location_units location_type_of_unit location_mobility_type location_admin_district location_startdate] |
|
|
|
|
@attributes = CaseLog.attribute_names + %w[unittype_sh] + scheme_attributes + location_attributes |
|
|
|
|
replace_csv_id_fields_with_names |
|
|
|
|
order_csv_attributes |
|
|
|
|
|
|
|
|
|