migrate bilans bdf adapter to v3
This commit is contained in:
parent
c2f2b4ef2a
commit
0f083db32b
5 changed files with 88 additions and 60 deletions
|
@ -9,7 +9,7 @@ class APIEntreprise::API
|
|||
EFFECTIFS_ANNUELS_RESOURCE_NAME = "v2/effectifs_annuels_acoss_covid/%{id}"
|
||||
ATTESTATION_SOCIALE_RESOURCE_NAME = "v4/urssaf/unites_legales/%{id}/attestation_vigilance"
|
||||
ATTESTATION_FISCALE_RESOURCE_NAME = "v4/dgfip/unites_legales/%{id}/attestation_fiscale"
|
||||
BILANS_BDF_RESOURCE_NAME = "v2/bilans_entreprises_bdf/%{id}"
|
||||
BILANS_BDF_RESOURCE_NAME = "v3/banque_de_france/unites_legales/%{id}/bilans"
|
||||
PRIVILEGES_RESOURCE_NAME = "v2/privileges"
|
||||
|
||||
TIMEOUT = 20
|
||||
|
|
|
@ -11,13 +11,17 @@ class APIEntreprise::BilansBdfAdapter < APIEntreprise::Adapter
|
|||
end
|
||||
|
||||
def process_params
|
||||
if data_source[:bilans].present?
|
||||
{
|
||||
entreprise_bilans_bdf: data_source[:bilans],
|
||||
entreprise_bilans_bdf_monnaie: data_source[:monnaie]
|
||||
}
|
||||
else
|
||||
{}
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue