2020-08-05 18:40:47 +02:00
|
|
|
class APIEntreprise::RNAAdapter < APIEntreprise::Adapter
|
2023-05-30 11:32:59 +02:00
|
|
|
# Doc métier : https://entreprise.api.gouv.fr/catalogue/djepva/associations_open_data
|
|
|
|
# Swagger : https://entreprise.api.gouv.fr/developpeurs/openapi#tag/Informations-generales/paths/~1v4~1djepva~1api-association~1associations~1open_data~1%7Bsiren_or_rna%7D/get
|
2022-09-22 17:13:53 +02:00
|
|
|
|
2018-03-19 15:45:55 +01:00
|
|
|
private
|
|
|
|
|
|
|
|
def get_resource
|
2022-07-20 14:52:17 +02:00
|
|
|
api(@procedure_id).rna(@siret)
|
2018-03-19 15:45:55 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def process_params
|
2023-05-30 11:32:59 +02:00
|
|
|
data = data_source[:data]
|
|
|
|
return {} if data.nil?
|
2023-01-11 12:12:24 +01:00
|
|
|
|
|
|
|
Sentry.with_scope do |scope|
|
|
|
|
scope.set_tags(siret: @siret)
|
2023-05-30 11:32:59 +02:00
|
|
|
scope.set_extras(source: data)
|
|
|
|
|
|
|
|
{
|
|
|
|
"association_rna" => data[:rna],
|
|
|
|
"association_titre" => data[:nom],
|
|
|
|
"association_objet" => data[:activites][:objet],
|
|
|
|
"association_date_creation" => data[:date_creation],
|
|
|
|
"association_date_declaration" => data[:date_publication_journal_officiel],
|
|
|
|
"association_date_publication" => data[:date_publication_journal_officiel]
|
|
|
|
}
|
2018-02-28 17:16:03 +01:00
|
|
|
end
|
2015-12-11 10:36:16 +01:00
|
|
|
end
|
|
|
|
end
|