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 # type_de_champ_id :integer
# #
class Champs::DepartementChamp < Champs::TextChamp class Champs::DepartementChamp < Champs::TextChamp
def for_export
[name, code]
end
def to_s def to_s
formatted_value formatted_value
end end

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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