2020-08-05 18:40:47 +02:00
|
|
|
class APIEntreprise::EffectifsAdapter < APIEntreprise::Adapter
|
2020-05-14 14:41:54 +02:00
|
|
|
def initialize(siret, procedure_id, annee, mois)
|
|
|
|
@siret = siret
|
2020-04-07 14:20:22 +02:00
|
|
|
@procedure_id = procedure_id
|
|
|
|
@annee = annee
|
|
|
|
@mois = mois
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def get_resource
|
2022-07-20 14:52:17 +02:00
|
|
|
api(@procedure_id).effectifs(siren, @annee, @mois)
|
2020-04-07 14:20:22 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def process_params
|
|
|
|
if data_source[:effectifs_mensuels].present?
|
|
|
|
{
|
2020-04-21 20:26:07 +02:00
|
|
|
entreprise_effectif_mensuel: data_source[:effectifs_mensuels],
|
2020-06-09 18:49:09 +02:00
|
|
|
entreprise_effectif_mois: data_source[:mois],
|
|
|
|
entreprise_effectif_annee: data_source[:annee]
|
2020-04-07 14:20:22 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|