2020-08-05 18:40:47 +02:00
|
|
|
class APIEntreprise::BilansBdfAdapter < APIEntreprise::Adapter
|
2020-05-14 14:41:54 +02:00
|
|
|
def initialize(siret, procedure_id)
|
|
|
|
@siret = siret
|
2020-04-30 08:18:17 +02:00
|
|
|
@procedure_id = procedure_id
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def get_resource
|
2022-07-20 14:52:17 +02:00
|
|
|
api(@procedure_id).bilans_bdf(siren)
|
2020-04-30 08:18:17 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def process_params
|
2023-05-28 13:10:18 +02:00
|
|
|
Sentry.with_scope do |scope|
|
|
|
|
data = data_source[:data]
|
|
|
|
scope.set_tags(siret: @siret)
|
|
|
|
scope.set_extras(source: data)
|
|
|
|
|
|
|
|
result = {}
|
|
|
|
if data
|
|
|
|
result[:entreprise_bilans_bdf] = data
|
|
|
|
result[:entreprise_bilans_bdf_monnaie] = 'euros'
|
|
|
|
end
|
|
|
|
result
|
2020-04-30 08:18:17 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|