# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/ClassLength

class EtablissementAttrsFromLine
  include Singleton

  def call(line)
    siret = line[:siren] + line[:nic]

    {
      siren: line[:siren],
      siret: siret,
      nic: line[:nic],
      l1_normalisee: line[:l1_normalisee],
      l2_normalisee: line[:l2_normalisee],
      l3_normalisee: line[:l3_normalisee],
      l4_normalisee: line[:l4_normalisee],
      l5_normalisee: line[:l5_normalisee],
      l6_normalisee: line[:l6_normalisee],
      l7_normalisee: line[:l7_normalisee],
      l1_declaree: line[:l1_declaree],
      l2_declaree: line[:l2_declaree],
      l3_declaree: line[:l3_declaree],
      l4_declaree: line[:l4_declaree],
      l5_declaree: line[:l5_declaree],
      l6_declaree: line[:l6_declaree],
      l7_declaree: line[:l7_declaree],
      numero_voie: line[:numvoie],
      indice_repetition: line[:indrep],
      type_voie: line[:typvoie],
      libelle_voie: line[:libvoie],
      code_postal: line[:codpos],
      cedex: line[:cedex],
      region: line[:rpet],
      libelle_region: line[:libreg],
      departement: line[:depet],
      arrondissement: line[:arronet],
      canton: line[:ctonet],
      commune: line[:comet],
      libelle_commune: line[:libcom],
      departement_unite_urbaine: line[:du],
      taille_unite_urbaine: line[:tu],
      numero_unite_urbaine: line[:uu],
      etablissement_public_cooperation_intercommunale: line[:epci],
      tranche_commune_detaillee: line[:tcd],
      zone_emploi: line[:zemet],
      is_siege: line[:siege],
      enseigne: line[:enseigne],
      indicateur_champ_publipostage: line[:ind_publipo],
      statut_prospection: line[:diffcom],
      date_introduction_base_diffusion: line[:amintret],
      nature_entrepreneur_individuel: line[:natetab],
      libelle_nature_entrepreneur_individuel: line[:libnatetab],
      activite_principale: line[:apet700],
      libelle_activite_principale: line[:libapet],
      date_validite_activite_principale: line[:dapet],
      tranche_effectif_salarie: line[:tefet],
      libelle_tranche_effectif_salarie: line[:libtefet],
      tranche_effectif_salarie_centaine_pret: line[:efetcent],
      date_validite_effectif_salarie: line[:defet],
      origine_creation: line[:origine],
      date_creation: line[:dcret],
      date_debut_activite: line[:ddebact],
      nature_activite: line[:activnat],
      lieu_activite: line[:lieuact],
      type_magasin: line[:actisurf],
      is_saisonnier: line[:saisonat],
      modalite_activite_principale: line[:modet],
      caractere_productif: line[:prodet],
      participation_particuliere_production: line[:prodpart],
      caractere_auxiliaire: line[:auxilt],
      nom_raison_sociale: line[:nomen_long],
      sigle: line[:sigle],
      nom: line[:nom],
      prenom: line[:prenom],
      civilite: line[:civilite],
      numero_rna: line[:rna],
      nic_siege: line[:nicsiege],
      region_siege: line[:rpen],
      departement_commune_siege: line[:depcomen],
      email: line[:adr_mail],
      nature_juridique_entreprise: line[:nj],
      libelle_nature_juridique_entreprise: line[:libnj],
      activite_principale_entreprise: line[:apen700],
      libelle_activite_principale_entreprise: line[:libapen],
      date_validite_activite_principale_entreprise: line[:dapen],
      activite_principale_registre_metier: line[:aprm],
      is_ess: line[:ess],
      date_ess: line[:dateess],
      tranche_effectif_salarie_entreprise: line[:tefen],
      libelle_tranche_effectif_salarie_entreprise: line[:libtefen],
      tranche_effectif_salarie_entreprise_centaine_pret: line[:efencent],
      date_validite_effectif_salarie_entreprise: line[:defen],
      categorie_entreprise: line[:categorie],
      date_creation_entreprise: line[:dcren],
      date_introduction_base_diffusion_entreprise: line[:amintren],
      indice_monoactivite_entreprise: line[:monoact],
      modalite_activite_principale_entreprise: line[:moden],
      caractere_productif_entreprise: line[:proden],
      date_validite_rubrique_niveau_entreprise_esa: line[:esaann],
      tranche_chiffre_affaire_entreprise_esa: line[:tca],
      activite_principale_entreprise_esa: line[:esaapen],
      premiere_activite_secondaire_entreprise_esa: line[:esasec1n],
      deuxieme_activite_secondaire_entreprise_esa: line[:esasec2n],
      troisieme_activite_secondaire_entreprise_esa: line[:esasec3n],
      quatrieme_activite_secondaire_entreprise_esa: line[:esasec4n],
      nature_mise_a_jour: line[:vmaj],
      indicateur_mise_a_jour_1: line[:vmaj1],
      indicateur_mise_a_jour_2: line[:vmaj2],
      indicateur_mise_a_jour_3: line[:vmaj3],
      date_mise_a_jour: line[:datemaj],
      longitude: line[:longitude],
      latitude: line[:latitude],
      geo_score: line[:geo_score],
      geo_type: line[:geo_type],
      geo_adresse: line[:geo_adresse],
      geo_id: line[:geo_id],
      geo_ligne: line[:geo_ligne],
      geo_l4: line[:geo_l4],
      geo_l5: line[:geo_l5]
    }
  end
end

# rubocop:enable Metrics/ClassLength
# rubocop:enable Metrics/MethodLength
# rubocop:enable Metrics/AbcSize
