refactor: rename naf => code_naf
This commit is contained in:
parent
f1d14bd6af
commit
9cb547efcf
7 changed files with 8 additions and 4 deletions
|
@ -159,7 +159,7 @@ module ColumnsConcern
|
|||
|
||||
etablissement_dates = ['entreprise_date_creation'].map { |column| dossier_col(table: 'etablissement', column:, type: :date) }
|
||||
|
||||
for_export = ["siege_social", "naf", "adresse", "numero_voie", "type_voie", "nom_voie", "complement_adresse", "localite", "code_insee_localite", "entreprise_siren", "entreprise_capital_social", "entreprise_numero_tva_intracommunautaire", "entreprise_forme_juridique_code", "entreprise_code_effectif_entreprise", "entreprise_etat_administratif", "entreprise_nom", "entreprise_prenom", "association_rna", "association_titre", "association_objet", "association_date_creation", "association_date_declaration", "association_date_publication"]
|
||||
for_export = ["siege_social", "code_naf", "adresse", "numero_voie", "type_voie", "nom_voie", "complement_adresse", "localite", "code_insee_localite", "entreprise_siren", "entreprise_capital_social", "entreprise_numero_tva_intracommunautaire", "entreprise_forme_juridique_code", "entreprise_code_effectif_entreprise", "entreprise_etat_administratif", "entreprise_nom", "entreprise_prenom", "association_rna", "association_titre", "association_objet", "association_date_creation", "association_date_declaration", "association_date_publication"]
|
||||
.map { |column| dossier_col(table: 'etablissement', column:, displayable: false, filterable: false) }
|
||||
|
||||
other = ['siret', 'libelle_naf', 'code_postal'].map { |column| dossier_col(table: 'etablissement', column:) }
|
||||
|
|
|
@ -21,6 +21,8 @@ class Etablissement < ApplicationRecord
|
|||
|
||||
after_commit -> { dossier&.index_search_terms_later }
|
||||
|
||||
alias_attribute :code_naf, :naf
|
||||
|
||||
# See https://github.com/demarches-simplifiees/demarches-simplifiees.fr/pull/10591#discussion_r1819399688
|
||||
# SIRET is already exposed as base column.
|
||||
DISPLAYABLE_COLUMNS = {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
- c.with_value do
|
||||
%p= etablissement.libelle_naf
|
||||
|
||||
= render Dossiers::RowShowComponent.new(label: "Libellé NAF") do |c|
|
||||
= render Dossiers::RowShowComponent.new(label: "Code NAF") do |c|
|
||||
- c.with_value do
|
||||
%p= etablissement.naf
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ en:
|
|||
entreprise_date_creation: Entreprise date de création
|
||||
siret: Établissement SIRET
|
||||
libelle_naf: Libellé NAF
|
||||
code_naf: Code NAF
|
||||
siege_social: "Établissement siège social"
|
||||
naf: "Établissement NAF"
|
||||
adresse: "Établissement Adresse"
|
||||
|
|
|
@ -54,6 +54,7 @@ fr:
|
|||
entreprise_date_creation: Entreprise date de création
|
||||
siret: Établissement SIRET
|
||||
libelle_naf: Libellé NAF
|
||||
code_naf: Code NAF
|
||||
siege_social: "Établissement siège social"
|
||||
naf: "Établissement NAF"
|
||||
adresse: "Établissement Adresse"
|
||||
|
|
|
@ -36,9 +36,9 @@ describe Columns::DossierColumn do
|
|||
expect(procedure.find_column(label: "Date de création").value(dossier)).to be_an_instance_of(ActiveSupport::TimeWithZone)
|
||||
expect(procedure.find_column(label: "Établissement SIRET").value(dossier)).to eq('44011762001530')
|
||||
expect(procedure.find_column(label: "Libellé NAF").value(dossier)).to eq('Transports par conduites')
|
||||
expect(procedure.find_column(label: "Code NAF").value(dossier)).to eq('4950Z')
|
||||
expect(procedure.find_column(label: "Établissement code postal").value(dossier)).to eq('92270')
|
||||
expect(procedure.find_column(label: "Établissement siège social").value(dossier)).to eq(true)
|
||||
expect(procedure.find_column(label: "Établissement NAF").value(dossier)).to eq('4950Z')
|
||||
expect(procedure.find_column(label: "Établissement Adresse").value(dossier)).to eq("GRTGAZ\r IMMEUBLE BORA\r 6 RUE RAOUL NORDLING\r 92270 BOIS COLOMBES\r")
|
||||
expect(procedure.find_column(label: "Établissement numero voie").value(dossier)).to eq('6')
|
||||
expect(procedure.find_column(label: "Établissement type voie").value(dossier)).to eq('RUE')
|
||||
|
|
|
@ -187,8 +187,8 @@ describe ColumnsConcern do
|
|||
procedure.find_column(label: "France connecté ?"),
|
||||
procedure.find_column(label: "Établissement SIRET"),
|
||||
procedure.find_column(label: "Établissement siège social"),
|
||||
procedure.find_column(label: "Établissement NAF"),
|
||||
procedure.find_column(label: "Libellé NAF"),
|
||||
procedure.find_column(label: "Code NAF"),
|
||||
procedure.find_column(label: "Établissement Adresse"),
|
||||
procedure.find_column(label: "Établissement numero voie"),
|
||||
procedure.find_column(label: "Établissement type voie"),
|
||||
|
|
Loading…
Reference in a new issue