feat(api particulier): add MESRI support to sources service

This commit is contained in:
François Vantomme 2021-12-08 11:34:37 +01:00 committed by simon lehericey
parent 693a95904e
commit 66a9109cd7
2 changed files with 29 additions and 1 deletions

View file

@ -80,7 +80,13 @@ module APIParticulier
'pole_emploi_identite' => ['pole_emploi', 'identite'],
'pole_emploi_adresse' => ['pole_emploi', 'adresse'],
'pole_emploi_contact' => ['pole_emploi', 'contact'],
'pole_emploi_inscription' => ['pole_emploi', 'inscription']
'pole_emploi_inscription' => ['pole_emploi', 'inscription'],
'mesri_identifiant' => ['mesri', 'identifiant'],
'mesri_identite' => ['mesri', 'identite'],
'mesri_inscription_etudiant' => ['mesri', 'inscriptions'],
'mesri_inscription_autre' => ['mesri', 'inscriptions'],
'mesri_admission' => ['mesri', 'admissions'],
'mesri_etablissements' => ['mesri', 'etablissements']
}
end
@ -123,6 +129,13 @@ module APIParticulier
'adresse' => ['INSEECommune', 'codePostal', 'localite', 'ligneVoie', 'ligneComplementDestinataire', 'ligneComplementAdresse', 'ligneComplementDistribution', 'ligneNom'],
'contact' => ['email', 'telephone', 'telephone2'],
'inscription' => ['dateInscription', 'dateCessationInscription', 'codeCertificationCNAV', 'codeCategorieInscription', 'libelleCategorieInscription']
},
'mesri' => {
'identifiant' => ['ine'],
'identite' => ['nom', 'prenom', 'dateNaissance'],
'inscriptions' => ['statut', 'regime', 'dateDebutInscription', 'dateFinInscription', 'codeCommune'],
'admissions' => ['statut', 'regime', 'dateDebutAdmission', 'dateFinAdmission', 'codeCommune'],
'etablissements' => ['uai', 'nom']
}
}
end

View file

@ -62,6 +62,21 @@ describe APIParticulier::Services::SourcesService do
it { is_expected.to match(pole_emploi_identite_et_adresse) }
end
context 'when a procedure has a mesri_identite and a mesri_etablissements scopes' do
let(:api_particulier_scopes) { ['mesri_identite', 'mesri_etablissements'] }
let(:mesri_identite_and_etablissements) do
{
'mesri' => {
'identite' => ['nom', 'prenom', 'dateNaissance'],
'etablissements' => ['uai', 'nom']
}
}
end
it { is_expected.to match(mesri_identite_and_etablissements) }
end
context 'when a procedure has an unknown scope' do
let(:api_particulier_scopes) { ['unknown_scope'] }