Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions config/authorization_request_forms/api_particulier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ api-particulier-familea: &api_particulier_familea
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Domino web 2.0 | Gestion des structures de petites enfances, enfance et jeunesse
description: |
Expand Down Expand Up @@ -119,6 +120,7 @@ api-particulier-arpege-concerto:
displayed:
- cnaf_quotient_familial
- cnaf_allocataires
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Tarification sur Quotient Familial des prestations Périscolaire
description: |
Expand Down Expand Up @@ -154,6 +156,7 @@ api-particulier-cantine-de-france:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape
initialize_with:
intitule:
Récupération du Quotient Familial ainsi que les informations administratives
Expand Down Expand Up @@ -196,6 +199,7 @@ api-particulier-agora-plus:
- cnaf_quotient_familial
- cnaf_allocataires
- cnaf_adresse
- cnav_allocation_enfant_handicape
initialize_with:
intitule:
Dématérialisation du calcul du quotient/taux d'effort pour les structures
Expand Down Expand Up @@ -236,6 +240,7 @@ api-particulier-amiciel-malice:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

initialize_with:
intitule:
Expand Down Expand Up @@ -345,6 +350,7 @@ api-particulier-city-family-mushroom-software:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Calcul du quotient familial pour la facturations des crèches, du périscolaire, du scolaire et de l’extrascolaire
description: Gestion des activités enfance, jeunesse, petite enfance (facturations des crèches, du périscolaire, du scolaire et de l’extrascolaire). Portail famille et back-office
Expand Down Expand Up @@ -392,6 +398,7 @@ api-particulier-civil-enfance-ciril-group:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

# Scopes FranceConnect
- family_name
Expand Down Expand Up @@ -434,6 +441,7 @@ api-particulier-cosoluce-fluo:
- cnaf_quotient_familial
displayed:
- cnaf_quotient_familial
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Récupération des données CNAF pour les services municipaux
description: Logiciel utilisé par des agents habilités pour la facturation des cantines
Expand Down Expand Up @@ -466,6 +474,7 @@ api-particulier-nfi:
- cnaf_allocataires
- cnaf_adresse
- cnaf_enfants
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Gestion de la relation client sur le portail famille
description: |
Expand Down Expand Up @@ -500,6 +509,7 @@ api-particulier-technocarte-ile:
displayed:
- cnaf_quotient_familial
- cnaf_allocataires
- cnav_allocation_enfant_handicape
initialize_with:
intitule:
Récupération du Quotient Familial pour le service Enfance (Périscolaire,
Expand Down Expand Up @@ -543,6 +553,7 @@ api-particulier-waigeo-myperischool:
- cnaf_allocataires
- cnaf_adresse
- cnaf_enfants
- cnav_allocation_enfant_handicape

# Scopes FranceConnect
- family_name
Expand Down Expand Up @@ -585,6 +596,7 @@ api-particulier-3d-ouest:
displayed:
- cnaf_quotient_familial
- cnaf_allocataires
- cnav_allocation_enfant_handicape

initialize_with:
intitule:
Expand Down Expand Up @@ -627,6 +639,7 @@ api-particulier-agedi-proxima-enf:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

initialize_with:
intitule: Tarification service enfance et récupération des quotients familiaux
Expand Down Expand Up @@ -668,6 +681,7 @@ api-particulier-ecorestauration-loyfeey:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

initialize_with:
intitule: Tarification sur Quotient Familial des cantines
Expand Down Expand Up @@ -707,6 +721,7 @@ api-particulier-jcdeveloppement-familyclic:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

initialize_with:
intitule: Tarification sur Quotient Familial des cantines
Expand Down Expand Up @@ -749,6 +764,7 @@ api-particulier-aiga:
- openid
displayed:
- cnaf_quotient_familial
- cnav_allocation_enfant_handicape

# Scopes FranceConnect
- family_name
Expand Down Expand Up @@ -1091,6 +1107,7 @@ api-particulier-bl-enfance-berger-levrault:
- cnaf_quotient_familial
displayed:
- cnaf_quotient_familial
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Tarification sur Quotient Familial des activités scolaires, périscolaires et loisirs
description: |
Expand Down Expand Up @@ -1125,6 +1142,7 @@ api-particulier-noethys:
- cnaf_allocataires
- cnaf_adresse
- cnaf_enfants
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Récupération du Quotient Familial pour le service enfance (Périscolaire, centre de loisirs)
description: |
Expand Down Expand Up @@ -1159,6 +1177,7 @@ api-particulier-carte-plus:
- cnaf_allocataires
- cnaf_adresse
- cnaf_enfants
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Récupération du Quotient Familial pour le service enfance (Périscolaire, centre de loisirs)
description: |
Expand Down Expand Up @@ -1198,6 +1217,7 @@ api-particulier-resagenda:
- cnaf_allocataires
- cnaf_adresse
- cnaf_enfants
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Récupération du Quotient Familial pour le service enfance (Périscolaire, centre de loisirs)
description: |
Expand Down Expand Up @@ -1281,6 +1301,7 @@ api-particulier-jvs-mairistem:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

initialize_with:
intitule: Facturation des familles pour les services périscolaires et loisirs
Expand Down Expand Up @@ -1373,6 +1394,7 @@ api-particulier-ypok-ykidz:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape

# Scopes FranceConnect
- family_name
Expand Down Expand Up @@ -1446,6 +1468,7 @@ api-particulier-e1os:
- cnaf_quotient_familial
displayed:
- cnaf_quotient_familial
- cnav_allocation_enfant_handicape

initialize_with:
intitule: Facturation des familles pour les services scolaire et cantine
Expand Down Expand Up @@ -1476,6 +1499,7 @@ api-particulier-acheteza:
- cnaf_quotient_familial
displayed:
- cnaf_quotient_familial
- cnav_allocation_enfant_handicape

initialize_with:
intitule: Facturation des familles pour les services scolaire et cantine
Expand Down Expand Up @@ -1902,6 +1926,7 @@ api-particulier-entrouvert-publik:
- cnaf_quotient_familial
- cnaf_allocataires
- cnaf_enfants
- cnav_allocation_enfant_handicape

# Scopes FranceConnect
- family_name
Expand Down Expand Up @@ -2888,6 +2913,7 @@ api-particulier-andyvie:
- cnaf_allocataires
- cnaf_enfants
- cnaf_adresse
- cnav_allocation_enfant_handicape
initialize_with:
intitule: Tarification des services municipaux à l’enfance
description: |
Expand Down
34 changes: 34 additions & 0 deletions spec/acceptance/authorizations_configs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,38 @@ def block_exists?(kind, name)
end
end
end

describe 'AEEH scope on tarification municipale enfance editor forms' do
subject(:editor_forms) do
AuthorizationRequestForm.all.select do |form|
form.use_case.to_s == 'tarification_municipale_enfance' && form.service_provider.present?
end
end

let(:aeeh_scope) { 'cnav_allocation_enfant_handicape' }

def scope_displayed?(form, scope_value)
hidden = form.scopes_config[:hide]
return false if hidden.present? && hidden.include?(scope_value)

displayed = form.scopes_config[:displayed]
displayed.blank? || displayed.include?(scope_value)
end

it 'targets every editor form of the use case' do
expect(editor_forms).not_to be_empty
end

it 'displays the scope on each editor form' do
editor_forms.each do |form|
expect(scope_displayed?(form, aeeh_scope)).to be_truthy, "Form: #{form.uid} does not display #{aeeh_scope}"
end
end

it 'never pre-checks the scope' do
editor_forms.each do |form|
expect(form.initialize_with[:scopes] || []).not_to include(aeeh_scope), "Form: #{form.uid} pre-checks #{aeeh_scope}"
end
end
end
end
2 changes: 1 addition & 1 deletion spec/models/authorization_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
context 'with displayed config on form' do
let(:authorization_request) { create(:authorization_request, :api_particulier_familea) }

it { expect(available_scopes.map(&:value)).to match_array(%w[cnaf_quotient_familial cnaf_allocataires cnaf_enfants cnaf_adresse]) }
it { expect(available_scopes.map(&:value)).to match_array(%w[cnaf_quotient_familial cnaf_allocataires cnaf_enfants cnaf_adresse cnav_allocation_enfant_handicape]) }
end
end

Expand Down