feat(export): add pays, region and departement codes

This commit is contained in:
Paul Chavard 2022-12-20 22:11:34 +01:00
parent 3f0f5e381f
commit bd9fe7eb7c
7 changed files with 30 additions and 0 deletions

View file

@ -21,6 +21,10 @@
# type_de_champ_id :integer
#
class Champs::DepartementChamp < Champs::TextChamp
def for_export
[name, code]
end
def to_s
formatted_value
end

View file

@ -21,6 +21,10 @@
# type_de_champ_id :integer
#
class Champs::PaysChamp < Champs::TextChamp
def for_export
[formatted_value, code]
end
def to_s
formatted_value
end

View file

@ -21,6 +21,10 @@
# type_de_champ_id :integer
#
class Champs::RegionChamp < Champs::TextChamp
def for_export
[name, code]
end
def selected
code
end

View file

@ -1,2 +1,5 @@
class TypesDeChamp::DepartementTypeDeChamp < TypesDeChamp::TextTypeDeChamp
def libelle_for_export(index)
[libelle, "#{libelle} (Code)"][index]
end
end

View file

@ -1,2 +1,5 @@
class TypesDeChamp::PaysTypeDeChamp < TypesDeChamp::TextTypeDeChamp
def libelle_for_export(index)
[libelle, "#{libelle} (Code)"][index]
end
end

View file

@ -1,2 +1,5 @@
class TypesDeChamp::RegionTypeDeChamp < TypesDeChamp::TextTypeDeChamp
def libelle_for_export(index)
[libelle, "#{libelle} (Code)"][index]
end
end

View file

@ -68,8 +68,11 @@ describe ProcedureExportService do
"communes (Code insee)",
"communes (Département)",
"departements",
"departements (Code)",
"regions",
"regions (Code)",
"pays",
"pays (Code)",
"dossier_link",
"piece_justificative",
"rna",
@ -172,8 +175,11 @@ describe ProcedureExportService do
"communes (Code insee)",
"communes (Département)",
"departements",
"departements (Code)",
"regions",
"regions (Code)",
"pays",
"pays (Code)",
"dossier_link",
"piece_justificative",
"rna",
@ -259,8 +265,11 @@ describe ProcedureExportService do
"communes (Code insee)",
"communes (Département)",
"departements",
"departements (Code)",
"regions",
"regions (Code)",
"pays",
"pays (Code)",
"dossier_link",
"piece_justificative",
"rna",