Skip to content

Commit

Permalink
Merge pull request #560 from etalab/features/fqf-habilitation
Browse files Browse the repository at this point in the history
  • Loading branch information
skelz0r authored Nov 29, 2024
2 parents 34f14f0 + 4419cc8 commit d9407c6
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 19 deletions.
6 changes: 1 addition & 5 deletions app/controllers/authorization_definitions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ class AuthorizationDefinitionsController < AuthenticatedUserController
include SubdomainsHelper

def index
@authorization_definitions = if registered_subdomain?
registered_subdomain.authorization_definitions
else
AuthorizationDefinition.indexable
end
@authorization_definitions = policy_scope(AuthorizationDefinition)

return unless @authorization_definitions.count == 1

Expand Down
7 changes: 0 additions & 7 deletions app/models/authorization_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ def editors
}.map(&:service_provider).uniq(&:id).sort_by(&:name)
end

def self.indexable
where(
public: true,
startable_by_applicant: true,
)
end

def self.build(uid, hash)
new(
hash.slice(
Expand Down
11 changes: 11 additions & 0 deletions app/models/authorization_request/formulaire_qf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AuthorizationRequest::FormulaireQF < AuthorizationRequest
include AuthorizationExtensions::CadreJuridique
include AuthorizationExtensions::PersonalData

%i[
contact_metier
delegue_protection_donnees
].each do |contact_kind|
contact contact_kind, validation_condition: ->(record) { record.need_complete_validation?(:contacts) }
end
end
7 changes: 0 additions & 7 deletions app/models/authorization_request_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ def scopes_config
@scopes_config || {}
end

def self.indexable
where(
public: true,
startable_by_applicant: true,
)
end

def multiple_steps?
steps.any?
end
Expand Down
11 changes: 11 additions & 0 deletions app/policies/authorization_definition_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AuthorizationDefinitionPolicy < ApplicationPolicy
class Scope < Scope
def resolve
if registered_subdomain?
scope.where(public: true, startable_by_applicant: true, id: registered_subdomain.authorization_definitions.map(&:id))
else
scope.where(public: true, startable_by_applicant: true)
end
end
end
end
4 changes: 4 additions & 0 deletions app/views/authorization_requests/new/api_particulier.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@
href="https://particulier.api.gouv.fr/faq#je-recherche-un-editeur-proposant-l-api-particulier"
target="_blank"
>consulter la liste</a>.
<br/>
<br/>
Si votre cas d'usage est d'accéder au quotient familial CAF et MSA pour simplifier la tarification sociale municipale, vous pouvez demander un accès au
<%= link_to 'formulaire de collecte du quotient familial', new_authorization_request_path(definition_id: 'formulaire_qf') %>
</p>
</div>
</div>
Expand Down
13 changes: 13 additions & 0 deletions config/authorization_definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -570,3 +570,16 @@ shared:
value: "openid"
group: "Données techniques"
included: true

formulaire_qf:
name: Formulaire d'accès au Quotient Familial
description: "Accéder au quotient familial CAF & MSA pour simplifier la tarification sociale municipale à l'enfance par le biais du \"formulaire de collecte du quotient familial\" et du portail agent HubEE."
provider: "dinum"
kind: 'service'
link: "https://quotient-familial.numerique.gouv.fr/"
cgu_link: "https://quotient-familial.numerique.gouv.fr/cgu_administrations"
access_link: "https://quotient-familial.numerique.gouv.fr/"
public: false
blocks:
- name: "legal"
- name: "contacts"
13 changes: 13 additions & 0 deletions config/authorization_request_forms/formulaire_qf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
formulaire-qf:
name: Tarification sociale des services municipaux à l'enfance
introduction: |
Accéder au quotient familial CAF & MSA pour simplifier la tarification sociale municipale à l'enfance par le biais du "formulaire de collecte du quotient familial" et du portail agent HubEE.
authorization_request: FormulaireQF
steps:
- name: legal
- name: personal_data
- name: contacts
data:
cadre_juridique_nature: |+
- Cadre légal général : L'article L114-8 du Code des relations entre le public et l’administration qui fixe le cadre général qui oblige l’administration à échanger des données lors d’une démarche d’un usager.
destinataire_donnees_caractere_personnel: Agents de la municipalité
1 change: 1 addition & 0 deletions config/initializers/inflections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
inflect.acronym 'INSEE'
inflect.acronym 'NAF'
inflect.acronym 'CRM'
inflect.acronym 'QF'

inflect.acronym 'HubEE'
inflect.acronym 'DC'
Expand Down
3 changes: 3 additions & 0 deletions config/locales/authorization_request_forms.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,6 @@ fr:
<a href="mailto:[email protected]" target="_blank">[email protected]</a>
api_impot_particulier_editeur: *api_impot_particulier_sandbox

formulaire_qf:
legal: *api_particulier_editor_common_wordings
1 change: 1 addition & 0 deletions config/subdomains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ shared:
tagline: "Habilitations juridiques pour API Particulier"
authorization_definition_ids:
- "api_particulier"
- "formulaire_qf"
hubee:
name: "HubEE"
title: "DataPass - HubEE"
Expand Down
25 changes: 25 additions & 0 deletions features/habilitations/formulaire_qf.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# language: fr

Fonctionnalité: Soumission d'une demande d'habilitation Formulaire QF
Contexte:
Sachant que je suis un demandeur
Et que je me connecte

Scénario: Je soumets une demande d'habilitation valide
* je démarre une nouvelle demande d'habilitation "Formulaire d'accès au Quotient Familial"

* je renseigne le cadre légal
* je clique sur "Suivant"

* je renseigne les infos concernant les données personnelles
* je clique sur "Suivant"

* je renseigne les informations du délégué à la protection des données
* je renseigne les informations du contact métier
* je clique sur "Suivant"

* j'adhère aux conditions générales
* je clique sur "Soumettre la demande d'habilitation"

Alors il y a un message de succès contenant "soumise avec succès"
Et je suis sur la page "Demandes et habilitations"
9 changes: 9 additions & 0 deletions spec/factories/authorization_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,5 +482,14 @@

france_connect
end

trait :formulaire_qf do
type { 'AuthorizationRequest::FormulaireQF' }

form_uid { 'formulaire-qf' }

with_cadre_juridique
with_personal_data
end
end
end

0 comments on commit d9407c6

Please sign in to comment.