From 58b8e7b3845cfd3108e5c90950fe4c4e941c11fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Wed, 19 Jun 2024 11:17:00 +0200 Subject: [PATCH 01/16] DatapassWebhook::AdaptV2ToV1 affects all authorization request data Prepare to exploit modalities field for access --- app/interactors/datapass_webhook/adapt_v2_to_v1.rb | 1 + spec/organizers/datapass_webhook/v2/api_particulier_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/interactors/datapass_webhook/adapt_v2_to_v1.rb b/app/interactors/datapass_webhook/adapt_v2_to_v1.rb index 7a4dc7f91..d5d3139c8 100644 --- a/app/interactors/datapass_webhook/adapt_v2_to_v1.rb +++ b/app/interactors/datapass_webhook/adapt_v2_to_v1.rb @@ -1,6 +1,7 @@ class DatapassWebhook::AdaptV2ToV1 < ApplicationInteractor def call context.event = context.event.sub('authorization_request', 'enrollment') + context.authorization_request_data = generic_data.dup context.data = build_data end diff --git a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb index 6c857b030..65ba4311f 100644 --- a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb +++ b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb @@ -71,4 +71,8 @@ subject end end + + it 'affects authorization request data to authorization_request_data on context' do + expect(subject.authorization_request_data).to eq(datapass_webhook_params['data']['data']) + end end From 4a124897e3828ed8b449b5af52cfb90069c7a7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Wed, 19 Jun 2024 11:33:29 +0200 Subject: [PATCH 02/16] API Particulier DataPass webhook : do not create token if there is no params modalities --- .../datapass_webhook/create_or_prolong_token.rb | 5 +++++ app/organizers/datapass_webhook/api_particulier.rb | 2 ++ spec/factories/datapass_webhooks_v2.rb | 4 ++++ .../datapass_webhook/v2/api_particulier_spec.rb | 12 ++++++++++++ 4 files changed, 23 insertions(+) diff --git a/app/interactors/datapass_webhook/create_or_prolong_token.rb b/app/interactors/datapass_webhook/create_or_prolong_token.rb index cf67e2202..d1c7530cc 100644 --- a/app/interactors/datapass_webhook/create_or_prolong_token.rb +++ b/app/interactors/datapass_webhook/create_or_prolong_token.rb @@ -1,6 +1,11 @@ class DatapassWebhook::CreateOrProlongToken < ApplicationInteractor + before do + context.modalities ||= %w[params] + end + def call return if %w[approve validate].exclude?(context.event) + return if context.modalities.exclude?('params') token = create_or_prolong_token diff --git a/app/organizers/datapass_webhook/api_particulier.rb b/app/organizers/datapass_webhook/api_particulier.rb index 0ff90188f..3f5af2427 100644 --- a/app/organizers/datapass_webhook/api_particulier.rb +++ b/app/organizers/datapass_webhook/api_particulier.rb @@ -8,6 +8,8 @@ class APIParticulier < ApplicationOrganizer } context.api = 'particulier' + context.authorization_request_data ||= {} + context.modalities = context.authorization_request_data['modalities'].presence || %w[params] end organize ::DatapassWebhook::FindOrCreateUser, diff --git a/spec/factories/datapass_webhooks_v2.rb b/spec/factories/datapass_webhooks_v2.rb index 323b5dddd..6360112b0 100644 --- a/spec/factories/datapass_webhooks_v2.rb +++ b/spec/factories/datapass_webhooks_v2.rb @@ -60,5 +60,9 @@ contact_metier_given_name { 'Jacques' } contact_metier_family_name { 'Metier' } contact_metier_job_title { 'CMO' } + + modalities do + %w[params] + end end end diff --git a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb index 65ba4311f..ecc0e8d44 100644 --- a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb +++ b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb @@ -41,6 +41,18 @@ expect(last_token.api).to eq('particulier') end + context 'when modalities does no include params' do + before do + datapass_webhook_params['data']['data']['modalities'] = ['formulaire_qf'] + end + + it 'does not create a token' do + expect { + subject + }.not_to change(Token, :count) + end + end + describe 'Mailjet adding contacts' do it 'adds contacts to Entreprise mailjet list' do expect(Mailjet::Contactslist_managemanycontacts).to receive(:create).with( From a52a934e56721604b298f1fb3326c7a7e1940043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Wed, 19 Jun 2024 11:42:16 +0200 Subject: [PATCH 03/16] HubEE is an acronym Ignore specs file path name, does not handle well and not an issue. --- .rubocop.yml | 4 ++++ config/initializers/inflections.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 41ffc3e03..fad8c07b2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -93,6 +93,10 @@ Metrics/MethodLength: RSpec/NestedGroups: Enabled: false +RSpec/SpecFilePathFormat: + Exclude: + - "spec/**/*hubee*" + Naming/VariableNumber: Enabled: false diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 6cc7380eb..cd9d628eb 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -15,4 +15,6 @@ inflect.acronym 'HTTP' inflect.acronym 'FAQ' + + inflect.acronym 'HubEE' end From 56248bb3239bc9adddbeb4941673d14d3bb3f723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Wed, 19 Jun 2024 12:04:11 +0200 Subject: [PATCH 04/16] INSEE is an acronym --- config/initializers/inflections.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index cd9d628eb..8b31f8036 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -17,4 +17,5 @@ inflect.acronym 'FAQ' inflect.acronym 'HubEE' + inflect.acronym 'INSEE' end From deb867368b9e54f6d3dacd4db175fd3292bc1962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Fri, 21 Jun 2024 16:33:36 +0200 Subject: [PATCH 05/16] QF is an acronym --- config/initializers/inflections.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 8b31f8036..cac5b73cd 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -18,4 +18,6 @@ inflect.acronym 'HubEE' inflect.acronym 'INSEE' + + inflect.acronym 'QF' end From 9252ef357bb47116cdf07bf8e44f25f76c4fa048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Mon, 24 Jun 2024 17:28:13 +0200 Subject: [PATCH 06/16] Add extra_infos to authorization requests Prepare to store HubEE ids --- ...240624152759_add_extra_infos_to_authorization_requests.rb | 5 +++++ db/schema.rb | 1 + 2 files changed, 6 insertions(+) create mode 100644 db/migrate/20240624152759_add_extra_infos_to_authorization_requests.rb diff --git a/db/migrate/20240624152759_add_extra_infos_to_authorization_requests.rb b/db/migrate/20240624152759_add_extra_infos_to_authorization_requests.rb new file mode 100644 index 000000000..3db463e21 --- /dev/null +++ b/db/migrate/20240624152759_add_extra_infos_to_authorization_requests.rb @@ -0,0 +1,5 @@ +class AddExtraInfosToAuthorizationRequests < ActiveRecord::Migration[7.1] + def change + add_column :authorization_requests, :extra_infos, :jsonb, default: {} + end +end diff --git a/db/schema.rb b/db/schema.rb index 9e3385e3b..a5141ef0d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -34,6 +34,7 @@ t.string "siret" t.string "api", null: false t.string "demarche" + t.jsonb "extra_infos", default: {} t.uuid "public_id" t.index ["external_id"], name: "index_authorization_requests_on_external_id", unique: true, where: "(external_id IS NOT NULL)" end From 31df18935c63326886e6c931caa3c8efaefe0291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Wed, 19 Jun 2024 12:10:54 +0200 Subject: [PATCH 07/16] Introduce INSEESireneAPIClient Huge cherry-pick from DataPass v2 Ref https://github.com/etalab/data_pass/commit/7c36324b50c1cef85c7e840c583bed6ae8ef89f0 --- Gemfile | 3 + Gemfile.lock | 5 + app/clients/abstract_insee_api_client.rb | 23 +++++ app/clients/insee_api_authentication.rb | 19 ++++ app/clients/insee_sirene_api_client.rb | 15 +++ config/credentials/production.yml.enc | 2 +- config/credentials/sandbox.yml.enc | 2 +- config/credentials/staging.yml.enc | 2 +- config/credentials/test.yml.enc | 2 +- spec/clients/insee_sirene_api_client_spec.rb | 43 ++++++++ spec/fixtures/insee/13002526500013.json | 102 +++++++++++++++++++ spec/rails_helper.rb | 2 + spec/support/fixtures_helpers.rb | 17 ++++ spec/support/insee_sirene_api_mocks.rb | 28 +++++ 14 files changed, 261 insertions(+), 4 deletions(-) create mode 100644 app/clients/abstract_insee_api_client.rb create mode 100644 app/clients/insee_api_authentication.rb create mode 100644 app/clients/insee_sirene_api_client.rb create mode 100644 spec/clients/insee_sirene_api_client_spec.rb create mode 100644 spec/fixtures/insee/13002526500013.json create mode 100644 spec/support/fixtures_helpers.rb create mode 100644 spec/support/insee_sirene_api_mocks.rb diff --git a/Gemfile b/Gemfile index ed4443b5d..281261f14 100644 --- a/Gemfile +++ b/Gemfile @@ -77,6 +77,9 @@ gem 'ransack' gem 'wicked' gem 'rest-client' +gem 'faraday' +gem 'faraday-net_http' +gem 'faraday-retry' group :development, :test do gem 'awesome_print' diff --git a/Gemfile.lock b/Gemfile.lock index 35d11c50d..3ab1c6265 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -158,6 +158,8 @@ GEM faraday-net_http_persistent (2.1.0) faraday (~> 2.5) net-http-persistent (~> 4.0) + faraday-retry (2.2.1) + faraday (~> 2.0) ferrum (0.15) addressable (~> 2.5) concurrent-ruby (~> 1.1) @@ -583,6 +585,9 @@ DEPENDENCIES cuprite draper factory_bot_rails + faraday + faraday-net_http + faraday-retry gaffe good_job (~> 3.99) guard-rspec diff --git a/app/clients/abstract_insee_api_client.rb b/app/clients/abstract_insee_api_client.rb new file mode 100644 index 000000000..5b836e6fa --- /dev/null +++ b/app/clients/abstract_insee_api_client.rb @@ -0,0 +1,23 @@ +require 'faraday' + +class AbstractINSEEAPIClient + protected + + def http_connection(&block) + @http_connection ||= Faraday.new do |conn| + conn.request :retry, max: 5 + conn.response :raise_error + conn.response :json + conn.options.timeout = 2 + yield(conn) if block + end + end + + def consumer_key + Rails.application.credentials.insee_consumer_key + end + + def consumer_secret + Rails.application.credentials.insee_consumer_secret + end +end diff --git a/app/clients/insee_api_authentication.rb b/app/clients/insee_api_authentication.rb new file mode 100644 index 000000000..85154071c --- /dev/null +++ b/app/clients/insee_api_authentication.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class INSEEAPIAuthentication < AbstractINSEEAPIClient + def access_token + http_connection.post( + 'https://api.insee.fr/token', + 'grant_type=client_credentials', + { + 'Authorization' => "Basic #{encoded_client_id_and_secret}" + } + ).body['access_token'] + end + + private + + def encoded_client_id_and_secret + Base64.strict_encode64("#{consumer_key}:#{consumer_secret}") + end +end diff --git a/app/clients/insee_sirene_api_client.rb b/app/clients/insee_sirene_api_client.rb new file mode 100644 index 000000000..488ca977f --- /dev/null +++ b/app/clients/insee_sirene_api_client.rb @@ -0,0 +1,15 @@ +class INSEESireneAPIClient < AbstractINSEEAPIClient + def etablissement(siret:) + http_connection.get( + "https://api.insee.fr/entreprises/sirene/V3.11/siret/#{siret}" + ).body + end + + protected + + def http_connection + super do |conn| + conn.request :authorization, 'Bearer', -> { INSEEAPIAuthentication.new.access_token } + end + end +end diff --git a/config/credentials/production.yml.enc b/config/credentials/production.yml.enc index 63bb3d6a4..823be583e 100644 --- a/config/credentials/production.yml.enc +++ b/config/credentials/production.yml.enc @@ -1 +1 @@ -M5gdwdwjWlf+hTjO+DmDE7a0zjhBirqkabba5ufD06phHvzD6M2/PVv+VuipKiEWgi95+QEbb9BC1Acod4ijkVvTUM2QqnVvBZ6Vw4ExFQVhkKh8iJ/2PUadTy0XnczuW9+lw21oy1jzeRICLUHVk/GYSWKOkgpiax+jG4S2cHpSyn2G7FCjyUW9DwaRwxE767YGlA0ySNH/UJT0WLoqVyZEzOknraWfGBD70+1vQaEJPdmNzF22ImDfrz+BTkGrB1NrHI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ybUny0+CuQy0D50nktb/2INiG058Ftxm+VLLpXkOD7OK8FQp0pdHMY61YTx1jzNQct76Rfmu3M7cVnIuB2fc3rYbyFCcI7TiBLB1HDPNuAzn/LpTyrxvfPIdkWL8GWq87uTmWcGlI0nVThGuqeNHlYZyqoIZoXnzxkt9N2S0ktdvu2GaoPGs4mlOCRwFc6Lw6sUQ1Hrdw/caEpXJwyXNZCgmSDUlUdhoGTfxoceeNIQGGL84woIdxfnKhBPw7R/uhhsS0CedQTwvrislOjF+2KUSClH6ZwVhMOdJeVBwDWR9I/ciZPVdw2s9dEEszuOy3/zBPQCCzi5Z0zKC2IcU8cie1B/3L4h9cpaZ3XVgmeS6eUA1jWT5EWXVoIwIl/FEISSc0zPJmUYjFg9SXuus6LWrZR5vk3tHX1jroJQaSnT4SS4Bv5UrQl8Rw07egEMwoQ=--k6YsEMrLlvY6jubO--wU/6yAay4Duogv8wIrNwpw== \ No newline at end of file diff --git a/config/credentials/sandbox.yml.enc b/config/credentials/sandbox.yml.enc index a9fa2cd98..d4a03a175 100644 --- a/config/credentials/sandbox.yml.enc +++ b/config/credentials/sandbox.yml.enc @@ -1 +1 @@ -WXXMzkxUMGPk9DyWjuIoBM7ei3Qxi1M3mgKXW0jpEmW3DD7SJ4CVm7VnfuerOq59nDBeugTdY34h6DWSXQQ+d/ZpgxDDBX/TASWj5tBYjjYu+g7bYGsvXwYnGNJd7xnAD8zCndBAhwfQn7TXnCzhCCytrNvLen61+scndaPRNv3ipIC/ct+NlsogiEyB/3XXntZhm7Seu/2UdO5VNSFzQlW03m+6r226Tv/17oMPR8+ZF6z/jY+igJBhOQIAD8pKfSau+ju/mSJMVdKCkM+AYWQKiDHYwS5LJIKsdK3sRIIuXbDeijo2EgiwV9HniUbloD6ElDpTf0VAj4s30ZYxIJGfy0S4ZIOsmummBk+jUEoi3GqwFMNpgMRwpVVTnDdI+opVOk6trSf0F9dv2sD8j20jXBR1lrSLN/7RXgpd+iunivJ1191AxdLsDuz/nFkUye1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EfqkG3s/Shph46W8VT9DJTktGeyhJ7xzgo7rJFv8sRv3SBQuNYYOBahDsFmlHazCyaDsXuR49ir6L2zOaDj9aeazcPam3EccodmZqHTVWnKaB6TSQX/+X0u96R5WDJGxkOh6MMPd+gIShW/96O8nQpK18F/fdfCBpmM6QwbF6lb80zDGNXbx9qH2a4bRfoW3AGAfXSD/ehzzqZAP4fmoVoT4p1EUAAz1pTYqNdhOjxfEt6u545yTKdcT8YTfVd2Jnyj+3mRntDpleauV9A07XneenI3NyQPCfxNwZALVJ1Zg22/aY+1vJdiK8WkBrKqvkbDP8yqCauDDRR/Rk8e/mbbjdRkBY5zijLdM2WCjB2uy0gKVrBr8BtzeiXiVYR4rKMNyKgIcwuGOX68NSZvUiXaVx6Pnk56hHjDJuxEJoYCBi3g6QA1JWY+onau10MC2BdtA/Z0xpxewXmLTrQq7bHNLwd3OJJ7abM952qr932yh3ileCj4He8fdhgXOHTEwLuH3CwC8i3IkZE5LRvLWU5mRK5nEf5bKVLTe6X9nVi5Yarm/lMQr1YTwX14rWaR/hTo5qm5yJzz5+WJVsXqH3ASkb/VWTob2uNUFk3MuXfxn4ksXTmJBvt3d0+hYd3W5fbO8XhEsUPziqDa752XB4O6csnYHR/cxA6acB2nvSrJXVzLHkwuqevIYiZ6Cdg06Uw8QLv0H3KmM4hNNaxR+GFEysEVT69f2qQZzqaCluMboj0wO+ebzcsc4Z7LPt/NmWt0Gi+fol--72FPeAqvxPtPmx2/--If1Hki/TxWi7If032tO13Q== \ No newline at end of file diff --git a/config/credentials/staging.yml.enc b/config/credentials/staging.yml.enc index 0a007e35d..a290917c3 100644 --- a/config/credentials/staging.yml.enc +++ b/config/credentials/staging.yml.enc @@ -1 +1 @@ -9JD9jNdU7DCiqe0LAHSWFuB7ANmPinU32C0Fv1YkQhItRWtWKcGo+fsbv/Z/T2UbwKB8CMBRM2zwL4sKedcWBw+uTACeA/86k1kQJXuLZO/X3XuTAf2jOLLLo11YLXBYthN2tkXl+qXH2dyOv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C3qmu+jihqXLAXEEr7bMJrV77mDSukzgU48vt+9J27QfHZshdm5aABCu2lQx+7AI8ZrNgNVO+j0mOr8dxgtEQ+AylLPcbzf8sn/knr4/G1rdxUv9BkkxY0gbWOHS0Tr3Oqyn+DgVF3wuQOU0slcXa1rBlATWCK4xphTrsPzXbZ2/br2hjzPBdw--SnT5ipZ6Jr48x3Mu--mJVJxv0C6+5hN6kVvoYr6g== \ No newline at end of file diff --git a/config/credentials/test.yml.enc b/config/credentials/test.yml.enc index de8b4b441..fe826246b 100644 --- a/config/credentials/test.yml.enc +++ b/config/credentials/test.yml.enc @@ -1 +1 @@ -ADXpePqAwH/J5T8SGYvBbmZcw5VWezhEngFQVDYROdye9KoQ6OJ46aNYpBQW2W6wofG2IBQq19hpNcI8/X31I1RMOyvcRCnfeJ8nSFiCEH/6vnxySB3gpxEMfosQ2BZs3QOWe/ulB3JcoZE1nFMbD8GTBXK8U7YUHUNeAqJowOQ/5AE0/jVkDkoV2s/cZAdiSxAdvSU+flib16yrjVKdPlyyLDs6lnyNx9deps8Hd/FYy09bBvJ8srROXBLPpCaagYoKvxHSJTidj/n9yQ29Pdj4vyylaDaN2kCXZAVQ+XTwM/hz8bBhYlZZ6McWQU9QHyM/WeU7pTPMy+yNVTUvF2A5z4vd4vW4fON1rUOlHSULUNSyhvSWfZcmXF4LTpKX5By0qOFs8fbUrUZI2upto1wcCDL2e4bbw2TXxL1sZSNBzBN8da7w4pKeCppJshA4glDGN+z7jWHnn8mD1lqG1YuoVsmGwLDnoWbvQ+Ke5+0VVLiH4A6pzWC+oD0ZQF8ENDT8LpFwojwwB6EsfECG0GjWcEFEWyWddYTQ4QEv8360U/gpWAAZUp5Qcc9V5QZ+XNzFJS6Q3fLGxK+juOnRMcc8DJTEZUlFIemB6fDTAUCUODLjJdBYmj2rL+la4Ib8zYozqoLHNQYPPKentwl0bgQQSHiDMkXohDLb8nYcvg66KGdcRdvCtE7y1Q5vgNX4C+CkrWNGuynuQ4wpHnQ/b7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bpll0DataB3NnoFwl2jAusprX0lBOyMbYp1pMEwniXZHpekwmRUH2etM5jySfKiPnGzLtsZ7J6roENxPIZzXJgqYPXMex/i5GanPr4c4J91RYI2s4lYbuAZ1uBI+IAC1WTnq9pHuQy+uRBwWSIhERbMzsPkznWF/lp5C6afHEqztwY7VxemUjj4nGtv0/vrBeyBNx9rWdFGWG+BalKTInRuXZmT0RCSv1YtU608QpA8kvj8lYRAcpf5T7fOl9k1FXG4jNW6twRIRDG/l0Q7SP9rOOhciaWfWfalYubaUwAEpMMz0ULT1p32jKajuf+/kYJAmaT7F6P6KZe7IYgCvgQrPt+8XumQOITVchqEU9poE6fS/BC4WCet9FVqJykxHfJGgd1+cKKtB2vJnHlVJG0+TDHviKYNlGa/SulA3K1iEhSIGc9Awy7N5JuzN+JP8KN8acHcadwdCwe9vqncqz3t9ZPDDv9/c7CYJi6LbrgCbaBxI2xMaLOK1Gyc4bctO2t+YkS1XwqK7SBp4pz/U4Z9PLKuG6kOaNkKgSNZL//tqrnbYLaQXiPVQVOQIqhG+BVxl4gxeiYrrNH5VeQDWDW1dBg7Zy7E5aa+WGlM+9KNRo4Uuvdtp0VaD7vDGlYPz5GLXaJqBQmBYvHnSGKRw65/alFdhpyawFtgHG5Mpo8klfIQZo9GFysTNuyhowJxZgva8ip//DKtioQ5ZiNqi4T7JWuPVvowZnnORCUqApwIDD0sp5mBISHh3sbikCIeoor6JG245CBVANBEobHa7ub2RUTEa7oS31aK+KGUvbetdNqLoDavdjKi9T0WaABJBpfn7bw2YE6z9nM+hkiwlY7otNGKu7+7aNBikUL4iaa+N6uahyvKm78VqEmac5NS3ZuRySv1Kix9/K7lVAnou+hdN/TsAJprfsXjsxsidok1QBvU1RFSlog8h+ww==--emrCOiutLVO3FHMz--UVUGcuJTrHwOoVo9AKubUQ== \ No newline at end of file diff --git a/spec/clients/insee_sirene_api_client_spec.rb b/spec/clients/insee_sirene_api_client_spec.rb new file mode 100644 index 000000000..1695076fe --- /dev/null +++ b/spec/clients/insee_sirene_api_client_spec.rb @@ -0,0 +1,43 @@ +RSpec.describe INSEESireneAPIClient do + let(:insee_api_authentication) { instance_double(INSEEAPIAuthentication, access_token: 'access_token') } + + before do + allow(INSEEAPIAuthentication).to receive(:new).and_return(insee_api_authentication) + end + + describe '#etablissement' do + subject(:etablissement_payload) { described_class.new.etablissement(siret:) } + + let(:siret) { '13002526500013' } + + context 'when the API returns a 200' do + let(:valid_payload) { insee_sirene_api_etablissement_valid_payload(siret:) } + + before do + stub_request(:get, "https://api.insee.fr/entreprises/sirene/V3.11/siret/#{siret}").to_return( + status: 200, + headers: { 'Content-Type' => 'application/json' }, + body: valid_payload.to_json + ) + end + + it 'renders a valid json from payload' do + expect(etablissement_payload).to eq(valid_payload) + end + end + + context 'when API returns something else than 200' do + before do + stub_request(:get, "https://api.insee.fr/entreprises/sirene/V3.11/siret/#{siret}").to_return( + status: 404, + headers: { 'Content-Type' => 'application/json' }, + body: '' + ) + end + + it 'raises an error' do + expect { etablissement_payload }.to raise_error(Faraday::Error) + end + end + end +end diff --git a/spec/fixtures/insee/13002526500013.json b/spec/fixtures/insee/13002526500013.json new file mode 100644 index 000000000..af5c31feb --- /dev/null +++ b/spec/fixtures/insee/13002526500013.json @@ -0,0 +1,102 @@ +{ + "header": { + "statut": 200, + "message": "ok" + }, + "etablissement": { + "siren": "130025265", + "nic": "00013", + "siret": "13002526500013", + "statutDiffusionEtablissement": "O", + "dateCreationEtablissement": "2017-05-24", + "trancheEffectifsEtablissement": "22", + "anneeEffectifsEtablissement": "2021", + "activitePrincipaleRegistreMetiersEtablissement": null, + "dateDernierTraitementEtablissement": "2023-11-30T10:17:12", + "etablissementSiege": true, + "nombrePeriodesEtablissement": 1, + "uniteLegale": { + "etatAdministratifUniteLegale": "A", + "statutDiffusionUniteLegale": "O", + "dateCreationUniteLegale": "2017-05-24", + "categorieJuridiqueUniteLegale": "7120", + "denominationUniteLegale": "DIRECTION INTERMINISTERIELLE DU NUMERIQUE", + "sigleUniteLegale": "DINUM", + "denominationUsuelle1UniteLegale": null, + "denominationUsuelle2UniteLegale": null, + "denominationUsuelle3UniteLegale": null, + "sexeUniteLegale": null, + "nomUniteLegale": null, + "nomUsageUniteLegale": null, + "prenom1UniteLegale": null, + "prenom2UniteLegale": null, + "prenom3UniteLegale": null, + "prenom4UniteLegale": null, + "prenomUsuelUniteLegale": null, + "pseudonymeUniteLegale": null, + "activitePrincipaleUniteLegale": "84.11Z", + "nomenclatureActivitePrincipaleUniteLegale": "NAFRev2", + "identifiantAssociationUniteLegale": null, + "economieSocialeSolidaireUniteLegale": "N", + "societeMissionUniteLegale": null, + "caractereEmployeurUniteLegale": "N", + "trancheEffectifsUniteLegale": "22", + "anneeEffectifsUniteLegale": "2021", + "nicSiegeUniteLegale": "00013", + "dateDernierTraitementUniteLegale": "2023-11-30T10:17:13", + "categorieEntreprise": "PME", + "anneeCategorieEntreprise": "2021" + }, + "adresseEtablissement": { + "complementAdresseEtablissement": null, + "numeroVoieEtablissement": "20", + "indiceRepetitionEtablissement": null, + "typeVoieEtablissement": "AV", + "libelleVoieEtablissement": "DE SEGUR", + "codePostalEtablissement": "75007", + "libelleCommuneEtablissement": "PARIS 7", + "libelleCommuneEtrangerEtablissement": null, + "distributionSpecialeEtablissement": null, + "codeCommuneEtablissement": "75107", + "codeCedexEtablissement": null, + "libelleCedexEtablissement": null, + "codePaysEtrangerEtablissement": null, + "libellePaysEtrangerEtablissement": null + }, + "adresse2Etablissement": { + "complementAdresse2Etablissement": null, + "numeroVoie2Etablissement": null, + "indiceRepetition2Etablissement": null, + "typeVoie2Etablissement": null, + "libelleVoie2Etablissement": null, + "codePostal2Etablissement": null, + "libelleCommune2Etablissement": null, + "libelleCommuneEtranger2Etablissement": null, + "distributionSpeciale2Etablissement": null, + "codeCommune2Etablissement": null, + "codeCedex2Etablissement": null, + "libelleCedex2Etablissement": null, + "codePaysEtranger2Etablissement": null, + "libellePaysEtranger2Etablissement": null + }, + "periodesEtablissement": [ + { + "dateFin": null, + "dateDebut": "2017-05-24", + "etatAdministratifEtablissement": "A", + "changementEtatAdministratifEtablissement": false, + "enseigne1Etablissement": null, + "enseigne2Etablissement": null, + "enseigne3Etablissement": null, + "changementEnseigneEtablissement": false, + "denominationUsuelleEtablissement": null, + "changementDenominationUsuelleEtablissement": false, + "activitePrincipaleEtablissement": "84.11Z", + "nomenclatureActivitePrincipaleEtablissement": "NAFRev2", + "changementActivitePrincipaleEtablissement": false, + "caractereEmployeurEtablissement": "N", + "changementCaractereEmployeurEtablissement": false + } + ] + } +} \ No newline at end of file diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index f63c9ac57..f6447e6c4 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -84,6 +84,8 @@ config.include SpecsHelper config.include FeatureHelper, type: :feature config.include ExternalUrlHelper, type: :feature + config.include FixturesHelpers + config.include INSEESireneAPIMocks config.around(:each, :js) do |example| example.run_with_retry retry: example.metadata[:retry] || 3 diff --git a/spec/support/fixtures_helpers.rb b/spec/support/fixtures_helpers.rb new file mode 100644 index 000000000..430021fe4 --- /dev/null +++ b/spec/support/fixtures_helpers.rb @@ -0,0 +1,17 @@ +module FixturesHelpers + def fixture_exists?(path) + Rails.root.join('spec', 'fixtures', path).exist? + end + + def open_fixture(path) + File.open(File.join(File.dirname(__FILE__), '..', 'fixtures', path)) + end + + def read_fixture(path) + open_fixture(path).read + end + + def read_json_fixture(path) + JSON.parse(open_fixture(path).read) + end +end diff --git a/spec/support/insee_sirene_api_mocks.rb b/spec/support/insee_sirene_api_mocks.rb new file mode 100644 index 000000000..2c56643c4 --- /dev/null +++ b/spec/support/insee_sirene_api_mocks.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module INSEESireneAPIMocks + def insee_sirene_api_etablissement_valid_payload(siret:, full: false) + if full + read_json_fixture("insee/#{siret}.json") + else + { + 'header' => { + 'statut' => 200, + 'message' => 'OK' + }, + 'etablissement' => { + 'siren' => siret.first(9) + } + } + end + end + + def insee_sirene_api_not_found_payload + { + 'header' => { + 'statut' => 404, + 'message' => 'Not Found' + } + } + end +end From 03b42ac336e9519bef8b526f1c313c45fc8aab7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Fri, 21 Jun 2024 14:43:20 +0200 Subject: [PATCH 08/16] Introduce Organization model Will be used for HubEE --- app/models/authorization_request.rb | 4 ++++ app/models/organization.rb | 37 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 app/models/organization.rb diff --git a/app/models/authorization_request.rb b/app/models/authorization_request.rb index 99b125303..7e206c220 100644 --- a/app/models/authorization_request.rb +++ b/app/models/authorization_request.rb @@ -76,6 +76,10 @@ def most_recent_token has_one :contact_technique, through: :contact_technique_authorization_request_role has_one :contact_metier, through: :contact_metier_authorization_request_role + def organization + @organization ||= Organization.new(siret) + end + def contacts_no_demandeur contacts.reject { |user| user == demandeur } end diff --git a/app/models/organization.rb b/app/models/organization.rb new file mode 100644 index 000000000..d3bb2917f --- /dev/null +++ b/app/models/organization.rb @@ -0,0 +1,37 @@ +class Organization + attr_reader :siret + + def initialize(siret) + @siret = siret + end + + def denomination + unite_legale_insee_payload['denominationUniteLegale'] + end + + def code_commune_etablissement + adresse_etablissement_insee_payload['codeCommuneEtablissement'] + end + + def code_postal_etablissement + adresse_etablissement_insee_payload['codePostalEtablissement'] + end + + private + + def adresse_etablissement_insee_payload + etablissement_insee_payload['adresseEtablissement'] + end + + def etablissement_insee_payload + insee_payload['etablissement'] + end + + def unite_legale_insee_payload + etablissement_insee_payload['uniteLegale'] + end + + def insee_payload + @insee_payload ||= INSEESireneAPIClient.new.etablissement(siret:) + end +end From cf6e233446fdedcfc7af5e275d4042a774a1590e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Fri, 21 Jun 2024 16:31:12 +0200 Subject: [PATCH 09/16] Introduce HubEEAPIClient --- app/clients/abstract_hubee_api_client.rb | 23 ++++++++ app/clients/hubee_api_authentication.rb | 21 +++++++ app/clients/hubee_api_client.rb | 75 ++++++++++++++++++++++++ config/credentials/production.yml.enc | 2 +- config/credentials/sandbox.yml.enc | 2 +- config/credentials/staging.yml.enc | 2 +- config/credentials/test.yml.enc | 2 +- spec/clients/hubee_api_client_spec.rb | 67 +++++++++++++++++++++ spec/rails_helper.rb | 1 + spec/support/hubee_api_mocks.rb | 40 +++++++++++++ 10 files changed, 231 insertions(+), 4 deletions(-) create mode 100644 app/clients/abstract_hubee_api_client.rb create mode 100644 app/clients/hubee_api_authentication.rb create mode 100644 app/clients/hubee_api_client.rb create mode 100644 spec/clients/hubee_api_client_spec.rb create mode 100644 spec/support/hubee_api_mocks.rb diff --git a/app/clients/abstract_hubee_api_client.rb b/app/clients/abstract_hubee_api_client.rb new file mode 100644 index 000000000..934b0e481 --- /dev/null +++ b/app/clients/abstract_hubee_api_client.rb @@ -0,0 +1,23 @@ +require 'faraday' + +class AbstractHubEEAPIClient + protected + + def http_connection(&block) + @http_connection ||= Faraday.new do |conn| + conn.request :retry, max: 5 + conn.response :raise_error + conn.response :json + conn.options.timeout = 2 + yield(conn) if block + end + end + + def consumer_key + Rails.application.credentials.hubee_consumer_key + end + + def consumer_secret + Rails.application.credentials.hubee_consumer_secret + end +end diff --git a/app/clients/hubee_api_authentication.rb b/app/clients/hubee_api_authentication.rb new file mode 100644 index 000000000..953068b63 --- /dev/null +++ b/app/clients/hubee_api_authentication.rb @@ -0,0 +1,21 @@ +class HubEEAPIAuthentication < AbstractHubEEAPIClient + def access_token + http_connection.post( + auth_url, + 'grant_type=client_credentials&scope=ADMIN', + { + 'Authorization' => "Basic #{encoded_client_id_and_secret}" + } + ).body['access_token'] + end + + private + + def auth_url + Rails.application.credentials.hubee_auth_url + end + + def encoded_client_id_and_secret + Base64.strict_encode64("#{consumer_key}:#{consumer_secret}") + end +end diff --git a/app/clients/hubee_api_client.rb b/app/clients/hubee_api_client.rb new file mode 100644 index 000000000..68424f930 --- /dev/null +++ b/app/clients/hubee_api_client.rb @@ -0,0 +1,75 @@ +class HubEEAPIClient < AbstractHubEEAPIClient + class NotFound < StandardError; end + class AlreadyExists < StandardError; end + + def find_organization(organization) + http_connection.get("#{host}/referential/v1/organizations/SI-#{organization.siret}-#{organization.code_commune_etablissement}").body + rescue Faraday::ResourceNotFound + raise NotFound + end + + def create_organization(organization, email) + http_connection.post( + "#{host}/referential/v1/organizations", + { + type: 'SI', + companyRegister: organization.siret, + branchCode: organization.code_commune_etablissement, + email:, + name: organization.denomination, + postalCode: organization.code_postal_etablissement, + territory: organization.code_commune_etablissement, + status: 'Actif' + }.to_json, + 'Content-Type' => 'application/json' + ) + rescue Faraday::BadRequestError => e + raise AlreadyExists if already_exists_error?(e) + + raise + end + + def create_subscription(authorization_request, organization_payload, process_code) + http_connection.post( + "#{host}/referential/v1/subscriptions", + { + datapassId: authorization_request.external_id.to_i, + notificationFrequency: 'unitaire', + processCode: process_code, + subscriber: { + type: 'SI', + companyRegister: organization_payload['companyRegister'], + branchCode: organization_payload['branchCode'] + }, + email: authorization_request.demandeur.email, + status: 'Actif', + localAdministrator: { + email: authorization_request.demandeur.email + } + }.to_json, + 'Content-Type' => 'application/json' + ) + rescue Faraday::BadRequestError => e + raise AlreadyExists if already_exists_error?(e) + + raise + end + + protected + + def host + Rails.application.credentials.hubee_api_url + end + + def already_exists_error?(faraday_error) + faraday_error.response[:body]['errors'].any? do |error| + error['message'].include?('already exists') + end + end + + def http_connection + super do |conn| + conn.request :authorization, 'Bearer', -> { HubEEAPIAuthentication.new.access_token } + end + end +end diff --git a/config/credentials/production.yml.enc b/config/credentials/production.yml.enc index 823be583e..cabc0142e 100644 --- a/config/credentials/production.yml.enc +++ b/config/credentials/production.yml.enc @@ -1 +1 @@ -+6JDQCCjGqrtov4JTLXRDCZmAY3Ms/MwHvT+t/uv+L9ESjOmV3TJI6qi4VXzPMmiqP7pyBw2xrbFLIcYVBIMWOvNfDpduDW/Rc4NEPF6rW97tJtoZ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8erf9jD8M/ghkt289iYZ8Vm5AjRWieybMu39RSHcVLWNjuRFNfKaQv0fHp0gnaRfghCm3Uilzws/Ly+SBk5J8rX2/+HL8tFrBCHrpGFC7nBLoSJ7K1e/lq/UAgRkRbanFppEhEkjUsRIgB/CLKnBtg0UAwoOXjmKggagGzozKdvctc7EcEO0CustBaHCtvo0rh1/R3i47Rk9Ui2wM3JdSMjbGi6v1x7kl5wBo7mFh8dVVBT3DoJNupAUEaa7GHdc9wei24hoT5AfDTIANnd36xMsZaYtWc/nKkgjiALRr/w2RZ51tRXEEzsk4X3t3HA+9bAwAmaYJNMM4mRM4VyqXkDiJys6innd6NBnihCmp3WiHR7SyxAkT3y9zAQAThcvQ2vILnQ9vXUA1QCLhhRPBAvIyKlW6dVEsj4RuZ21fYG89jf9H6U70LRoAGYrWQsE96jndG601O0gmRffNc2+OJoHbA2fX3VAA5U1THNaHOKJdTjjgw0cmaHTSje/j4M52aJWm87LS5NJERKnuKO+888a/kv2nvJg==--8AwvpS+u7H/EDghs--eM7LS2qsBz5qPC/z+utNKw== \ No newline at end of file diff --git a/config/credentials/sandbox.yml.enc b/config/credentials/sandbox.yml.enc index d4a03a175..92e621b3b 100644 --- a/config/credentials/sandbox.yml.enc +++ b/config/credentials/sandbox.yml.enc @@ -1 +1 @@ -kI9E6SyaQdN6XBOjJ4tUTa7ZQ8GT9KWaNZgueI/XDHmkB7bukelJWMPL2WUFMy4GHTPmJPXhqjkmIbMFsKQiDLwYCiCY9s1eKHRvod1x1cj32/cADgo+ttI6+FIQWI1qZg87gL3oRAbpbCxBekYtOJk5btP1nZIixyqPA3XseeGx+vIMgw1uLaS2cGj3ck/CInyZQLInmlyZhnBGyF1s7RRX4l1z7Kt7v94cUskBjLwtnOwyMvbo1fTF2i0dUmXSKptADR+Giw67TivtUsnfhlKD1yt72UEZIGu6TzNxaqE/PKulBe4xuEgehH7lBugeqiHTPndtnzylqJk8JAmLWi0zoVQv7KTFaguQr9FctWE7vSDK4R+k2IET1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893ZeWbA9oXz2EGJNL5TZ0NxjxBGIXBNNC8lwXVj4uIk4WAdRbYAD4uCYgfjGQ/tHd2LLy1IRhp6hLRsTw0h/Ahc61asgMejaaYRZp5lB1vdOM+PKc1gjZrorLyxcAg5ETS8zeG3hwyNM8Z/vanO2FCzEb4h1FGlpSAgvVl58gLbKfbzA3epbqTPnWw71uj1tKe8WSwd3AZ+kRjqHnjU5oGmkpu4FXdD6rvpuoet5TWPgfFrgOmDGxNOT4KhNVTz/Sbp8LtoCHk5fAmD25rQEdUdTbSvGO+668aKKN6F58w==--sVa2IBBRCHcz0YkY--KqKofsqRXSMfN0XY3PEkxw== \ No newline at end of file diff --git a/config/credentials/staging.yml.enc b/config/credentials/staging.yml.enc index a290917c3..3524d000d 100644 --- a/config/credentials/staging.yml.enc +++ b/config/credentials/staging.yml.enc @@ -1 +1 @@ -TbB/elcmqQxp+kROraLOMdJvcR7ASGUEf57su2byIMFaa9KN8XoWIe7S/xPI2/eps27VAS51sLovETSAYVYupDdadGKuAAWPh4uTcAJsHmbXueggO1EE5GA6SGK1si87m/31ZC8UNVtyAb4dE5wh0lhbmHx1trYhDcF1ofpyxXWKrIGxP8KNDTJJFlAVV7ycWT7OCSAAhSDyDuQXP2EIs3i1IObPgoSUtnKqx8yLkTAMKIpqYdpSS51nrI3mB2WBkpeOslGRJ9Fz1t84LGwu7r9dYlNfwwVQee7vQoWKcSwWGUxh0z6Of7fxa2SdHkcRxsA8T198NNj70S3enNwoZATav8cUgGEIGBbh9nPZcOKqiAXJxrwT6sx7TfdURpYBkEox/9pD2hHyMocTeqiPQF1CwwiP5lYwCJrc+BezRM9WxvJyoHEzll/lkztN1ZOwm2vHLp388j9w2RdGlSNDgJgLzIlXXJUNTmUBr82cQG7trR8cYfS/eMuOb1OuBr1/NZYlA5aOxrJ3ihvK6JcuSpoi42EJqLjh6uf+9Fk75SkSK8QYgFF9T/y69YWasau3GG1VUKDSlJNJGUuKke80dDIE0pf9CI8JXN3+rINE2t/gReExe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a4lAsjzEZRjCnW0x0jnkCTIw0Py89wAmhTRu41p4yATDySr225Wb3LiqHhagd3FBCna5fh87p66gav5ebch2FkXXYrnwukXx2VUr02OgyBNmNNv19P0MVsiriTli4Kb+rK5GjupJehGX4RIK+IN5o67RcsnDiTfLHM88vduVpA/JqgjKwZZXklCLrQ0DIWjWz8OVDA4ga+ogyV/sn5RggLSL52vAeFWhLnIbZCntdB3ig==--XsN3Zq365PlsbdKl--Mxes8FOFobS+b+Yx+Ky+Lg== \ No newline at end of file diff --git a/config/credentials/test.yml.enc b/config/credentials/test.yml.enc index fe826246b..4400b7321 100644 --- a/config/credentials/test.yml.enc +++ b/config/credentials/test.yml.enc @@ -1 +1 @@ -5yjN1qvY9r3z4c2j7iLIuEMFr+4Mc1ytXDvkBx3+NVyHAZctBhpI8g2F2OXYq9zTLcgGhTGLLtI2w/HFIXd8+vAUljvR37r/YnzKRxzTRNC+j3O9Jle3qxbx5v5yg/SNM9JmeY3cEVvVaPnUgvSnOWmmiMfyZlKEFlx0Mbk6hbqGz1z1nxZwQFpGQ344s/S3MinI+VeOpjrnMYTdjZFMTKSlAkbpxWSOo5rg087leH28cFVK2+blOvMXfVWRJaquY9p6sPV5C9X+Q36uX0q2abuWFpIe0vBlHDcwL3iHq0oymei/BANQD76uLUONyffPRogU3RvbZjMWd/o34SMZ4rUmNUXAKl/LdmjbDZFBAMdigQnpMajIWdzHtNA6IWFvM6f5mv4euBazMsM5MKNg9787w1k6CDqQh7kwXIF6GthQuhjpdSSQmdE0D6KW1xkRWcj0wIWligMuZC96GepwJKQDwf4if27I5RKZ8v4PfU0EsHVhRzKc9E6yYpPXA7l+Q3+kYpqXLBaG4Ga3FKwaFPcU+ZFXqFRaXz3SEqt5Vy4nzQ62q2oQO0/Kglm3zt/eE3KJrpYWb5xGrGNHWQe7H8QQ6wGJjIB/YMF1BGkauXC4DUGZZ1vDCaxWAi/pRd0gsKCVdiZE0jJ7BEK4tvNyFtoeyHVMYFhlrjl9bZm1oOw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MFwB9zwP0iSqzoptGthnyNIxgBRhgwtBveNMKyW0Jqf/0WeDMaSln//7cURP+q5y3y3uS0bGPkTz+KnMvSpf8inuvP/VpmhhERgvUi5MFxt2MfKWJMCBULCDnWpG8LAvL/nrQfhdnnhE748sjgA2KAG4tLP3eDmYz5F44DgXxyWCpWV3d3riRq4+Eej1Rb8OgKdzza7e0X9bNsLxfRgw4fRhPH6+oR8dEDJdVTLvuOAepy1Apt1f9AD11nLyO7/jBOMKrY--dzjtM4Kf2fi6YpMd--1x7ObL5qvU6eia9C3p7sjA== \ No newline at end of file diff --git a/spec/clients/hubee_api_client_spec.rb b/spec/clients/hubee_api_client_spec.rb new file mode 100644 index 000000000..9e6b335d1 --- /dev/null +++ b/spec/clients/hubee_api_client_spec.rb @@ -0,0 +1,67 @@ +RSpec.describe HubEEAPIClient do + let(:hubee_api_authentication) { instance_double(HubEEAPIAuthentication, access_token: 'access_token') } + + before do + allow(HubEEAPIAuthentication).to receive(:new).and_return(hubee_api_authentication) + end + + describe '#find_organization' do + subject(:find_organization_payload) { described_class.new.find_organization(organization) } + + let(:organization) { Organization.new(siret) } + let(:siret) { '13002526500013' } + let(:code_commune) { '13055' } + let(:host) { Rails.application.credentials.hubee_api_url } + + before do + allow(organization).to receive(:code_commune_etablissement).and_return(code_commune) + end + + context 'when the API returns a 200' do + let(:valid_payload) { hubee_organization_payload(siret:, code_commune:) } + + before do + stub_request(:get, "#{host}/referential/v1/organizations/SI-#{siret}-#{code_commune}").to_return( + status: 200, + headers: { 'Content-Type' => 'application/json' }, + body: valid_payload.to_json + ) + end + + it 'renders a valid json from payload' do + expect(find_organization_payload).to eq(valid_payload) + end + end + + context 'when API returns 404' do + before do + stub_request(:get, "#{host}/referential/v1/organizations/SI-#{siret}-#{code_commune}").to_return( + status: 404, + headers: { 'Content-Type' => 'application/json' }, + body: { + 'header' => { + 'statut' => 404, + 'message' => "Aucun élément trouvé pour le siret #{siret}" + } + }.to_json + ) + end + + it 'raises a NotFound error' do + expect { find_organization_payload }.to raise_error(HubEEAPIClient::NotFound) + end + end + + context 'when API returns unknown status' do + before do + stub_request(:get, "#{host}/referential/v1/organizations/SI-#{siret}-#{code_commune}").to_return( + status: 500 + ) + end + + it 'raises an error' do + expect { find_organization_payload }.to raise_error(Faraday::Error) + end + end + end +end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index f6447e6c4..0ce2ebde0 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -86,6 +86,7 @@ config.include ExternalUrlHelper, type: :feature config.include FixturesHelpers config.include INSEESireneAPIMocks + config.include HubEEAPIMocks config.around(:each, :js) do |example| example.run_with_retry retry: example.metadata[:retry] || 3 diff --git a/spec/support/hubee_api_mocks.rb b/spec/support/hubee_api_mocks.rb new file mode 100644 index 000000000..cc21d99b1 --- /dev/null +++ b/spec/support/hubee_api_mocks.rb @@ -0,0 +1,40 @@ +module HubEEAPIMocks + def hubee_organization_payload(siret: '13002526500013', code_commune: '75017') + { + 'country' => 'France', + 'code' => 'DINUM', + 'postalCode' => '75007', + 'type' => 'SI', + 'companyRegister' => siret, + 'createDateTime' => '2021-05-20T15:59:02.569+00:00', + 'branchCode' => code_commune, + 'phoneNumber' => '0000000000', + 'name' => 'DIRECTION INTERMINISTERIELLE DU NUMERIQUE', + 'updateDateTime' => '2022-01-27T19:42:07.386+00:00', + 'email' => 'datapass@yopmail.com', + 'territory' => 'PARIS 7', + 'status' => 'Actif' + } + end + + def hubee_subscription_payload(authorization_request:, organization_payload: hubee_organization_payload, process_code: 'TEST') + { + 'id' => SecureRandom.uuid, + 'datapassId' => authorization_request.external_id.to_i, + 'notificationFrequency' => 'unitaire', + 'processCode' => process_code, + 'email' => authorization_request.demandeur.email, + 'localAdministrator' => { + 'email' => authorization_request.demandeur.email + }, + 'status' => 'Actif', + 'subscriber' => { + 'branchCode' => organization_payload['branchCode'], + 'companyRegister' => organization_payload['companyRegister'], + 'type' => 'SI' + }, + 'creationDateTime' => '2024-06-24T16:01:27.142+00:00', + 'updateDateTime' => '2024-06-24T16:01:27+0000' + } + end +end From 42389626841be09753b03f4e17bdc81aef21886a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Fri, 21 Jun 2024 17:34:07 +0200 Subject: [PATCH 10/16] Introduce CreateFormulaireQFHubEESubscriptionJob --- ...te_formulaire_qf_hubee_subscription_job.rb | 43 ++++++++ ...rmulaire_qf_hubee_subscription_job_spec.rb | 100 ++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 app/jobs/create_formulaire_qf_hubee_subscription_job.rb create mode 100644 spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb diff --git a/app/jobs/create_formulaire_qf_hubee_subscription_job.rb b/app/jobs/create_formulaire_qf_hubee_subscription_job.rb new file mode 100644 index 000000000..a74dcb2c1 --- /dev/null +++ b/app/jobs/create_formulaire_qf_hubee_subscription_job.rb @@ -0,0 +1,43 @@ +class CreateFormulaireQFHubEESubscriptionJob < ApplicationJob + def perform(authorization_request_id) + authorization_request = AuthorizationRequest.find(authorization_request_id) + + hubee_organization_payload = find_or_create_organization_on_hubee(authorization_request) + + authorization_request.extra_infos['hubee_organization_id'] = build_hubee_organization_id(hubee_organization_payload) + authorization_request.save! + + create_subscription_on_hubee(authorization_request, hubee_organization_payload) + rescue ActiveRecord::RecordNotFound + # do nothing + end + + private + + def find_or_create_organization_on_hubee(authorization_request) + hubee_api_client.find_organization(authorization_request.organization) + rescue HubEEAPIClient::NotFound + hubee_api_client.create_organization(authorization_request.organization, authorization_request.demandeur.email) + end + + def create_subscription_on_hubee(authorization_request, hubee_organization) + hubee_subscription_payload = hubee_api_client.create_subscription(authorization_request, hubee_organization, process_code) + + authorization_request.extra_infos['hubee_subscription_id'] = hubee_subscription_payload['id'] + authorization_request.save! + rescue HubEEAPIClient::AlreadyExists + # do nothing + end + + def build_hubee_organization_id(hubee_organization_payload) + "SI-#{hubee_organization_payload['companyRegister']}-#{hubee_organization_payload['branchCode']}" + end + + def process_code + 'FORMULAIRE_QF' + end + + def hubee_api_client + @hubee_api_client ||= HubEEAPIClient.new + end +end diff --git a/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb b/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb new file mode 100644 index 000000000..ad3984137 --- /dev/null +++ b/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb @@ -0,0 +1,100 @@ +RSpec.describe CreateFormulaireQFHubEESubscriptionJob, type: :job do + describe '#perform' do + subject(:create_formulaire_qf_hubee_subscription_job) do + described_class.perform_now(authorization_request.id) + end + + let(:hubee_api_client) { instance_double(HubEEAPIClient) } + let(:authorization_request) { create(:authorization_request, :with_demandeur, api: 'particulier') } + let(:subscription_payload) { hubee_subscription_payload(authorization_request:) } + + before do + allow(HubEEAPIClient).to receive(:new).and_return(hubee_api_client) + end + + context 'when organization does not exist on HubEE' do + let(:organization_payload) { hubee_organization_payload(siret:, code_commune:) } + let(:siret) { '12345678901234' } + let(:code_commune) { '12345' } + + before do + allow(hubee_api_client).to receive(:find_organization).and_raise(HubEEAPIClient::NotFound) + allow(hubee_api_client).to receive_messages(create_organization: organization_payload, create_subscription: subscription_payload) + end + + it 'creates an organization on HubEE' do + expect(hubee_api_client).to receive(:create_organization) + + create_formulaire_qf_hubee_subscription_job + end + + it 'stores the organization id on the authorization request' do + create_formulaire_qf_hubee_subscription_job + + expect(authorization_request.reload.extra_infos['hubee_organization_id']).to eq("SI-#{siret}-#{code_commune}") + end + + it 'creates a subscription on HubEE' do + expect(hubee_api_client).to receive(:create_subscription) + + create_formulaire_qf_hubee_subscription_job + end + + it 'stores the subscription id on the authorization request' do + create_formulaire_qf_hubee_subscription_job + + expect(authorization_request.reload.extra_infos['hubee_subscription_id']).to eq(subscription_payload['id']) + end + end + + context 'when organization exists on HubEE' do + before do + allow(hubee_api_client).to receive_messages(find_organization: hubee_organization_payload, create_subscription: subscription_payload) + end + + it 'does not create an organization on HubEE' do + expect(hubee_api_client).not_to receive(:create_organization) + + create_formulaire_qf_hubee_subscription_job + end + + it 'creates a subscription on HubEE' do + expect(hubee_api_client).to receive(:create_subscription) + + create_formulaire_qf_hubee_subscription_job + end + + it 'stores the subscription id on the authorization request' do + create_formulaire_qf_hubee_subscription_job + + expect(authorization_request.reload.extra_infos['hubee_subscription_id']).to eq(subscription_payload['id']) + end + end + + describe 'subscription creation' do + before do + allow(hubee_api_client).to receive(:find_organization).and_return(hubee_organization_payload) + end + + context 'when subscription already exists' do + before do + allow(hubee_api_client).to receive(:create_subscription).and_raise(HubEEAPIClient::AlreadyExists) + end + + it 'does not raise an error' do + expect { create_formulaire_qf_hubee_subscription_job }.not_to raise_error + end + end + + context 'when subscription failed' do + before do + allow(hubee_api_client).to receive(:create_subscription).and_raise(Faraday::Error) + end + + it 'raises an error' do + expect { create_formulaire_qf_hubee_subscription_job }.to raise_error(Faraday::Error) + end + end + end + end +end From d2f3d7ece5ed9f905d34b5487d2f8d7218f7a5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Mon, 24 Jun 2024 18:52:30 +0200 Subject: [PATCH 11/16] DatapassWebhook::APIParticulier handles formulaire QF HubEE subscription --- ...te_formulaire_qf_hubee_subscription_job.rb | 8 ++++ .../datapass_webhook/api_particulier.rb | 1 + .../v2/api_particulier_spec.rb | 44 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb diff --git a/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb b/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb new file mode 100644 index 000000000..4ebfc4213 --- /dev/null +++ b/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb @@ -0,0 +1,8 @@ +class DatapassWebhook::ScheduleCreateFormulaireQFHubEESubscriptionJob < ApplicationInteractor + def call + return unless context.event == 'approve' + return unless context.modalities.include?('formulaire_qf') + + CreateFormulaireQFHubEESubscriptionJob.perform_later(context.authorization_request.id) + end +end diff --git a/app/organizers/datapass_webhook/api_particulier.rb b/app/organizers/datapass_webhook/api_particulier.rb index 3f5af2427..372da114c 100644 --- a/app/organizers/datapass_webhook/api_particulier.rb +++ b/app/organizers/datapass_webhook/api_particulier.rb @@ -20,6 +20,7 @@ class APIParticulier < ApplicationOrganizer ::DatapassWebhook::ReopenAuthorizationRequest, ::DatapassWebhook::RevokeCurrentToken, ::DatapassWebhook::UpdateMailjetContacts, + ::DatapassWebhook::ScheduleCreateFormulaireQFHubEESubscriptionJob, ::DatapassWebhook::ExtractMailjetVariables, ::DatapassWebhook::ScheduleAuthorizationRequestEmails, ::DatapassWebhook::APIParticulier::NotifyReporters diff --git a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb index ecc0e8d44..179e697f0 100644 --- a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb +++ b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb @@ -53,6 +53,50 @@ end end + describe 'modalities' do + context 'when modalities does not include formulaire_qf' do + before do + datapass_webhook_params['data']['data']['modalities'] = ['params'] + end + + it 'does not schedule a job to create formulaire qf access on HubEE' do + expect { + subject + }.not_to have_enqueued_job(CreateFormulaireQFHubEESubscriptionJob) + end + end + + context 'when modalities include formulaire_qf' do + before do + datapass_webhook_params['data']['data']['modalities'] = ['formulaire_qf'] + end + + context 'when event is approve' do + before do + datapass_webhook_params['event'] = 'approve' + end + + it 'schedules a job to create formulaire qf access on HubEE' do + expect { + subject + }.to have_enqueued_job(CreateFormulaireQFHubEESubscriptionJob) + end + end + + context 'when event not approve' do + before do + datapass_webhook_params['event'] = 'reject' + end + + it 'does not schedule a job to create formulaire qf access on HubEE' do + expect { + subject + }.not_to have_enqueued_job(CreateFormulaireQFHubEESubscriptionJob) + end + end + end + end + describe 'Mailjet adding contacts' do it 'adds contacts to Entreprise mailjet list' do expect(Mailjet::Contactslist_managemanycontacts).to receive(:create).with( From 3191e733b45663dc8688fe1fcbeb8eeeb3833266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Thu, 27 Jun 2024 10:24:08 +0200 Subject: [PATCH 12/16] Remove useless module --- spec/rails_helper.rb | 1 - spec/support/fixtures_helpers.rb | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 spec/support/fixtures_helpers.rb diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 0ce2ebde0..2cee3272f 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -84,7 +84,6 @@ config.include SpecsHelper config.include FeatureHelper, type: :feature config.include ExternalUrlHelper, type: :feature - config.include FixturesHelpers config.include INSEESireneAPIMocks config.include HubEEAPIMocks diff --git a/spec/support/fixtures_helpers.rb b/spec/support/fixtures_helpers.rb deleted file mode 100644 index 430021fe4..000000000 --- a/spec/support/fixtures_helpers.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FixturesHelpers - def fixture_exists?(path) - Rails.root.join('spec', 'fixtures', path).exist? - end - - def open_fixture(path) - File.open(File.join(File.dirname(__FILE__), '..', 'fixtures', path)) - end - - def read_fixture(path) - open_fixture(path).read - end - - def read_json_fixture(path) - JSON.parse(open_fixture(path).read) - end -end From ec85fd53fd282b0f5286f546fe5fa0dcbc26258e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Delmaire?= Date: Tue, 2 Jul 2024 16:39:16 +0200 Subject: [PATCH 13/16] Update HubEEAPIClient with latest specs --- app/clients/hubee_api_client.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/clients/hubee_api_client.rb b/app/clients/hubee_api_client.rb index 68424f930..111b09ab4 100644 --- a/app/clients/hubee_api_client.rb +++ b/app/clients/hubee_api_client.rb @@ -45,7 +45,12 @@ def create_subscription(authorization_request, organization_payload, process_cod status: 'Actif', localAdministrator: { email: authorization_request.demandeur.email - } + }, + delegationActor: { + branchCode: organization_payload['branchCode'], + companyRegister: organization_payload['companyRegister'], + type: 'EDT' + }, }.to_json, 'Content-Type' => 'application/json' ) From a0819841e6045e58e8aaf21ddcb63e93bb56516f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Delmaire=20Lo=C3=AFc?= Date: Tue, 27 Aug 2024 15:02:37 +0200 Subject: [PATCH 14/16] Add valid process_code for Formulaire QF Co-authored-by: Jean-Baptiste Feldis <5403+jbfeldis@users.noreply.github.com> --- app/jobs/create_formulaire_qf_hubee_subscription_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/create_formulaire_qf_hubee_subscription_job.rb b/app/jobs/create_formulaire_qf_hubee_subscription_job.rb index a74dcb2c1..f7ae2426f 100644 --- a/app/jobs/create_formulaire_qf_hubee_subscription_job.rb +++ b/app/jobs/create_formulaire_qf_hubee_subscription_job.rb @@ -34,7 +34,7 @@ def build_hubee_organization_id(hubee_organization_payload) end def process_code - 'FORMULAIRE_QF' + 'FormulaireQF' end def hubee_api_client From 4f1339eefa1e6c12b16d4dfd75b97086008d5afe Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Feldis <5403+jbfeldis@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:38:17 +0200 Subject: [PATCH 15/16] =?UTF-8?q?Active=20l'abonnement=20HubEE=20et=20ajou?= =?UTF-8?q?te=20la=20collectivit=C3=A9=20sur=20FQF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les abonnements HubEE doivent être créées avant d'être activés, ce commit met en place cette séparation. Pour associer un éditeur le webhook envoie maintenant le service_provider associé à la demande (stocké dans extra_infos). Une méthode pour récupérer un abonnement existant a aussi été ajoutée pour rendre le webhook plus robuste. La collectivité est aussi créée du côté du FormulaireQF. --- Gemfile | 6 ++- Gemfile.lock | 8 ++++ app/clients/abstract_hubee_api_client.rb | 2 +- app/clients/formulaire_qf_api_client.rb | 35 ++++++++++++++ app/clients/hubee_api_authentication.rb | 7 +++ app/clients/hubee_api_client.rb | 46 +++++++++++++++---- .../datapass_webhook/adapt_v2_to_v1.rb | 3 +- .../find_or_create_authorization_request.rb | 9 +++- ...te_formulaire_qf_hubee_subscription_job.rb | 1 + .../create_formulaire_qf_collectivity_job.rb | 6 +++ ...te_formulaire_qf_hubee_subscription_job.rb | 33 ++++++++++--- config/credentials/test.yml.enc | 2 +- spec/factories/datapass_webhooks.rb | 9 ++++ ...nd_or_create_authorization_request_spec.rb | 4 ++ ...ate_formulaire_qf_collectivity_job_spec.rb | 20 ++++++++ ...rmulaire_qf_hubee_subscription_job_spec.rb | 6 +++ .../v2/api_particulier_spec.rb | 18 ++++++++ 17 files changed, 195 insertions(+), 20 deletions(-) create mode 100644 app/clients/formulaire_qf_api_client.rb create mode 100644 app/jobs/create_formulaire_qf_collectivity_job.rb create mode 100644 spec/jobs/create_formulaire_qf_collectivity_job_spec.rb diff --git a/Gemfile b/Gemfile index 281261f14..6f1563b98 100644 --- a/Gemfile +++ b/Gemfile @@ -78,8 +78,10 @@ gem 'wicked' gem 'rest-client' gem 'faraday' +gem 'faraday-gzip' gem 'faraday-net_http' gem 'faraday-retry' +gem 'faraday-encoding' group :development, :test do gem 'awesome_print' @@ -104,10 +106,10 @@ group :development do # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md gem 'rack-mini-profiler', '~> 3.3' gem 'rubocop', require: false - gem 'rubocop-rails' - gem 'rubocop-rspec' gem 'rubocop-capybara' gem 'rubocop-factory_bot' + gem 'rubocop-rails' + gem 'rubocop-rspec' gem 'rubocop-rspec_rails' gem 'better_errors' diff --git a/Gemfile.lock b/Gemfile.lock index 3ab1c6265..1f7a944d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -153,6 +153,11 @@ GEM railties (>= 5.0.0) faraday (2.9.0) faraday-net_http (>= 2.0, < 3.2) + faraday-encoding (0.0.6) + faraday + faraday-gzip (2.0.1) + faraday (>= 1.0) + zlib (~> 3.0) faraday-net_http (3.1.0) net-http faraday-net_http_persistent (2.1.0) @@ -562,6 +567,7 @@ GEM nokogiri (~> 1.8) yajl-ruby (1.4.3) zeitwerk (2.7.0) + zlib (3.1.1) PLATFORMS aarch64-linux @@ -586,6 +592,8 @@ DEPENDENCIES draper factory_bot_rails faraday + faraday-encoding + faraday-gzip faraday-net_http faraday-retry gaffe diff --git a/app/clients/abstract_hubee_api_client.rb b/app/clients/abstract_hubee_api_client.rb index 934b0e481..9081c04aa 100644 --- a/app/clients/abstract_hubee_api_client.rb +++ b/app/clients/abstract_hubee_api_client.rb @@ -4,7 +4,7 @@ class AbstractHubEEAPIClient protected def http_connection(&block) - @http_connection ||= Faraday.new do |conn| + Faraday.new do |conn| conn.request :retry, max: 5 conn.response :raise_error conn.response :json diff --git a/app/clients/formulaire_qf_api_client.rb b/app/clients/formulaire_qf_api_client.rb new file mode 100644 index 000000000..9d3582175 --- /dev/null +++ b/app/clients/formulaire_qf_api_client.rb @@ -0,0 +1,35 @@ +class FormulaireQFAPIClient + def create_collectivity(authorization_request) + organization = authorization_request.organization + editor_name = authorization_request.extra_infos.dig('service_provider', 'id') + + params = { + siret: organization.siret, + code_cog: organization.code_commune_etablissement, + departement: organization.code_postal_etablissement[0..1], + name: organization.denomination, + status: 'active', + editor: editor_name + } + + http_connection.post("#{host}/api/collectivites", params.to_json) + end + + private + + def host + Rails.application.credentials.formulaire_qf.host + end + + def http_connection(&block) + Faraday.new do |conn| + conn.headers['Content-Type'] = 'application/json' + conn.request :authorization, 'Bearer', -> { secret } + yield(conn) if block + end + end + + def secret + Rails.application.credentials.formulaire_qf.secret + end +end diff --git a/app/clients/hubee_api_authentication.rb b/app/clients/hubee_api_authentication.rb index 953068b63..76db47095 100644 --- a/app/clients/hubee_api_authentication.rb +++ b/app/clients/hubee_api_authentication.rb @@ -18,4 +18,11 @@ def auth_url def encoded_client_id_and_secret Base64.strict_encode64("#{consumer_key}:#{consumer_secret}") end + + def http_connection(&block) + @http_connection ||= super do |conn| + conn.response :json + yield(conn) if block + end + end end diff --git a/app/clients/hubee_api_client.rb b/app/clients/hubee_api_client.rb index 111b09ab4..4b057e44f 100644 --- a/app/clients/hubee_api_client.rb +++ b/app/clients/hubee_api_client.rb @@ -17,6 +17,7 @@ def create_organization(organization, email) branchCode: organization.code_commune_etablissement, email:, name: organization.denomination, + country: 'France', postalCode: organization.code_postal_etablissement, territory: organization.code_commune_etablissement, status: 'Actif' @@ -34,7 +35,7 @@ def create_subscription(authorization_request, organization_payload, process_cod "#{host}/referential/v1/subscriptions", { datapassId: authorization_request.external_id.to_i, - notificationFrequency: 'unitaire', + notificationFrequency: 'Aucune', processCode: process_code, subscriber: { type: 'SI', @@ -42,15 +43,12 @@ def create_subscription(authorization_request, organization_payload, process_cod branchCode: organization_payload['branchCode'] }, email: authorization_request.demandeur.email, - status: 'Actif', + status: 'Inactif', localAdministrator: { email: authorization_request.demandeur.email }, - delegationActor: { - branchCode: organization_payload['branchCode'], - companyRegister: organization_payload['companyRegister'], - type: 'EDT' - }, + validateDateTime: DateTime.now.iso8601, + updateDateTime: DateTime.now.iso8601 }.to_json, 'Content-Type' => 'application/json' ) @@ -60,6 +58,37 @@ def create_subscription(authorization_request, organization_payload, process_cod raise end + def find_subscription(_authorization_request, organization_payload, process_code) + request = http_connection { |conn| conn.request :gzip }.get( + "#{host}/referential/v1/subscriptions", + companyRegister: organization_payload['companyRegister'], + processCode: process_code + ) + request.body.first + end + + def update_subscription(authorization_request, subscription_payload, editor_payload = {}) + subscription_id = authorization_request.extra_infos['hubee_subscription_id'] + return if subscription_id.blank? + + payload = subscription_payload.with_indifferent_access.merge({ + status: 'Actif', + activateDateTime: DateTime.now.iso8601, + accessMode: 'API', + notificationFrequency: 'Aucune' + }.with_indifferent_access) + + payload.delete('id') + payload.delete('creationDateTime') + payload.merge!(editor_payload.with_indifferent_access) if editor_payload.present? + + http_connection.put( + "#{host}/referential/v1/subscriptions/#{subscription_id}", + payload.to_json, + 'Content-Type' => 'application/json' + ) + end + protected def host @@ -72,9 +101,10 @@ def already_exists_error?(faraday_error) end end - def http_connection + def http_connection(&block) super do |conn| conn.request :authorization, 'Bearer', -> { HubEEAPIAuthentication.new.access_token } + yield(conn) if block end end end diff --git a/app/interactors/datapass_webhook/adapt_v2_to_v1.rb b/app/interactors/datapass_webhook/adapt_v2_to_v1.rb index d5d3139c8..ec43c9d9f 100644 --- a/app/interactors/datapass_webhook/adapt_v2_to_v1.rb +++ b/app/interactors/datapass_webhook/adapt_v2_to_v1.rb @@ -22,7 +22,8 @@ def build_data 'previous_enrollment_id' => nil, 'scopes' => generic_data['scopes'].index_with { |_scope| true }, 'team_members' => build_team_members, - 'events' => [] + 'events' => [], + 'service_provider' => context.data['service_provider'], } } end diff --git a/app/interactors/datapass_webhook/find_or_create_authorization_request.rb b/app/interactors/datapass_webhook/find_or_create_authorization_request.rb index a16dcfb1d..2852598fa 100644 --- a/app/interactors/datapass_webhook/find_or_create_authorization_request.rb +++ b/app/interactors/datapass_webhook/find_or_create_authorization_request.rb @@ -72,10 +72,17 @@ def authorization_request_attributes ).merge(authorization_request_attributes_for_current_event).merge( 'last_update' => fired_at_as_datetime, 'previous_external_id' => context.data['pass']['copied_from_enrollment_id'], - 'api' => context.api + 'api' => context.api, + 'extra_infos' => extra_infos_with_service_provider ) end + def extra_infos_with_service_provider + context.authorization_request.extra_infos.merge({ + 'service_provider' => Hash(context.data.dig('pass', 'service_provider')) + }) + end + def authorization_request_attributes_for_current_event authorization_request_attributes_for_current_event = {} diff --git a/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb b/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb index 4ebfc4213..3a1e44b88 100644 --- a/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb +++ b/app/interactors/datapass_webhook/schedule_create_formulaire_qf_hubee_subscription_job.rb @@ -4,5 +4,6 @@ def call return unless context.modalities.include?('formulaire_qf') CreateFormulaireQFHubEESubscriptionJob.perform_later(context.authorization_request.id) + CreateFormulaireQFCollectivityJob.perform_later(context.authorization_request.id) end end diff --git a/app/jobs/create_formulaire_qf_collectivity_job.rb b/app/jobs/create_formulaire_qf_collectivity_job.rb new file mode 100644 index 000000000..f527ccaf4 --- /dev/null +++ b/app/jobs/create_formulaire_qf_collectivity_job.rb @@ -0,0 +1,6 @@ +class CreateFormulaireQFCollectivityJob < ApplicationJob + def perform(authorization_request_id) + authorization_request = AuthorizationRequest.find(authorization_request_id) + FormulaireQFAPIClient.new.create_collectivity(authorization_request) + end +end diff --git a/app/jobs/create_formulaire_qf_hubee_subscription_job.rb b/app/jobs/create_formulaire_qf_hubee_subscription_job.rb index f7ae2426f..9a3a4b62c 100644 --- a/app/jobs/create_formulaire_qf_hubee_subscription_job.rb +++ b/app/jobs/create_formulaire_qf_hubee_subscription_job.rb @@ -7,7 +7,23 @@ def perform(authorization_request_id) authorization_request.extra_infos['hubee_organization_id'] = build_hubee_organization_id(hubee_organization_payload) authorization_request.save! - create_subscription_on_hubee(authorization_request, hubee_organization_payload) + subscription_payload = find_or_create_subscription_on_hubee(authorization_request, hubee_organization_payload) + + service_provider = authorization_request.extra_infos['service_provider'] + subscription_update_payload = {} + + if service_provider.present? && service_provider['type'] == 'editor' + subscription_update_payload.merge!({ + delegationActor: { + branchCode: service_provider['code_cog'], + companyRegister: service_provider['siret'], + type: 'EDT' + }, + accessMode: 'API' + }) + end + + update_subscription_on_hubee(authorization_request, subscription_payload, subscription_update_payload) rescue ActiveRecord::RecordNotFound # do nothing end @@ -20,13 +36,18 @@ def find_or_create_organization_on_hubee(authorization_request) hubee_api_client.create_organization(authorization_request.organization, authorization_request.demandeur.email) end - def create_subscription_on_hubee(authorization_request, hubee_organization) - hubee_subscription_payload = hubee_api_client.create_subscription(authorization_request, hubee_organization, process_code) - - authorization_request.extra_infos['hubee_subscription_id'] = hubee_subscription_payload['id'] + def find_or_create_subscription_on_hubee(authorization_request, hubee_organization) + payload = hubee_api_client.create_subscription(authorization_request, hubee_organization, process_code) + authorization_request.extra_infos['hubee_subscription_id'] = payload['id'] authorization_request.save! rescue HubEEAPIClient::AlreadyExists - # do nothing + payload = hubee_api_client.find_subscription(authorization_request, hubee_organization, process_code) + authorization_request.extra_infos['hubee_subscription_id'] = payload['id'] + authorization_request.save! + end + + def update_subscription_on_hubee(authorization_request, subscription_payload, editor_payload) + hubee_api_client.update_subscription(authorization_request, subscription_payload, editor_payload) end def build_hubee_organization_id(hubee_organization_payload) diff --git a/config/credentials/test.yml.enc b/config/credentials/test.yml.enc index 4400b7321..26ec8c3a3 100644 --- a/config/credentials/test.yml.enc +++ b/config/credentials/test.yml.enc @@ -1 +1 @@ -zCEivVYu4bj2l1LSnXFlbXhTNV5NFRoA09/3q+9PwPcEtrLMZBIlr31hs0yWzXvWluCqNoH9N5ybeYGX28UgZhJypoURARvO9LK27B59a+e/uv5KMAAPmVkVlCe/TBHnFbBGnFzJWs/T4JziOAkJc1pTLRFMDv5RbFCC3rz9NPo469N2zl9U+44waK6UBdONwJn6Af/SEa0Ay7HAwnWor0pBV2yWuz02WYPTQyNrfNKt2fBt8iFoM2iTyTYxaUcovb+tVNNN/l6QqwflqmIMVMiMB1AYuyxlcS8BP1A+pBpoAWCVQVV+aKk/PFDRCqpiQetZGmD33iVmTZAoT6S3Hy+VTbKThTe8sYDbBt0O90zg5ZyzfMiHGnmYgeezVr9OvfxdVDZN+dHFZggfITugT1n1kpuHxh7WHxw9mTX+xx5IDqR6q7XvdzNzQoj3K+ao9tHYKUZ99UX9Jypn8t+IXtyQi7CcDELkm4T8oxKKZheBc5LkLZW72AM/wIUe7xumd77zphnDbNLAteA+bIeWTjlXhfW3pMrRFzYUkZp9Fl4WYllDDsfLGit8bIKFGTz/9k3aqEGTFAMaPhCfdHazqeiThFLV1J3uCp9CUctie9c46upSLKUAoKUwSfMb6vSvBYnuoDUjRmWpyt7Y2+qeWcZRsLtAk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d4VeTxtFl/dCa0wLHApYHfGYdrVgIjpEC0xMd/mennJz8chTm90xPciKS772UqewGZiUCFvFQ37d/bIOr+fyikFbYfM3+yMbpy183iBg1xuWklocFpZvRe4UMo1M8xCSHvr1T5gtOxC3pu4mb5NuzmH9KT1Z2Y41TRjy9jcS4JaOG4mDvZP75q5EmTkVXDopbdIbyCf77gCCmiVmRjCOI1igzwQyh96iDDDbw4RluUCZPjgEXEVj87d5VtXhjdDkqWLekEh3oCchboNShsKAUdkk0OvkAzXq6LDjj3VljNemVAb9krhIawXm6oJiBM9rQSnN22JQjfvzAIhQYOhp7/8jJKRbnZd5M9rcJNf1MxGxnHvxUHslWRN0SzzCMuihrAc3ZmcfzHBPPwGIgCJ7s8bgF2zBD8rRQvbNBxP35rF/zKvTR4npt7FwX37DjCjXTTtmYSQvdcRzUUBFpsA2WLBCQM/FsdTx2l8K8uRCxgYdaZbCQZhPMH8FIYW3aNdqxUdWETdMagBA2exnNJO2IvTg2fe6Nrur/bzorjhgoi7KqR13RypvOQYSJn+JIHrf3EIRy1pH3l4e888/928Cv9SvF5PsfIzCxW5VW3lISQW/LDp+W4ietq2RWE8EU43byA/vtHiVRjZ1bF23Hiiyq9XWchS--1iVrN2uZYhSZST7Q--wTX5GsuCHbFXF8Ki2bYStA== \ No newline at end of file diff --git a/spec/factories/datapass_webhooks.rb b/spec/factories/datapass_webhooks.rb index b574ba846..d2f5163c8 100644 --- a/spec/factories/datapass_webhooks.rb +++ b/spec/factories/datapass_webhooks.rb @@ -63,6 +63,15 @@ 'entreprises' => true } end + + service_provider do + { + 'id' => '3d_ouest', + 'type' => 'editor', + 'siret' => '44973625500018', + 'code' => '22113', + } + end end factory :datapass_webhook_team_member_model, class: Hash do diff --git a/spec/interactors/datapass_webhook/find_or_create_authorization_request_spec.rb b/spec/interactors/datapass_webhook/find_or_create_authorization_request_spec.rb index 35ef0d0bd..dc99f5929 100644 --- a/spec/interactors/datapass_webhook/find_or_create_authorization_request_spec.rb +++ b/spec/interactors/datapass_webhook/find_or_create_authorization_request_spec.rb @@ -68,6 +68,10 @@ expect(subject.reopening).to be_falsey end + it 'stores the service provider in extra_infos' do + expect { subject }.to change { authorization_request.reload.extra_infos['service_provider'] } + end + context 'when it is the same demandeur' do let(:demandeur) { build(:datapass_webhook_team_member_model, type: 'demandeur', email: authorization_request.demandeur.email) } diff --git a/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb b/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb new file mode 100644 index 000000000..e6162f900 --- /dev/null +++ b/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb @@ -0,0 +1,20 @@ +require 'rails_helper' + +RSpec.describe CreateFormulaireQFCollectivityJob, type: :job do + describe '#perform' do + subject(:job) { described_class.perform_now(authorization_request.id) } + + let(:api_client) { instance_double(FormulaireQFAPIClient) } + let(:authorization_request) { create(:authorization_request, :with_demandeur, api: 'particulier') } + + before do + allow(FormulaireQFAPIClient).to receive(:new).and_return(api_client) + end + + it 'creates collectivity on Formulaire QF' do + expect(api_client).to receive(:create_collectivity).with(authorization_request) + + job + end + end +end diff --git a/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb b/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb index ad3984137..bc1a6a99d 100644 --- a/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb +++ b/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb @@ -20,6 +20,7 @@ before do allow(hubee_api_client).to receive(:find_organization).and_raise(HubEEAPIClient::NotFound) allow(hubee_api_client).to receive_messages(create_organization: organization_payload, create_subscription: subscription_payload) + allow(hubee_api_client).to receive(:update_subscription) end it 'creates an organization on HubEE' do @@ -50,6 +51,7 @@ context 'when organization exists on HubEE' do before do allow(hubee_api_client).to receive_messages(find_organization: hubee_organization_payload, create_subscription: subscription_payload) + allow(hubee_api_client).to receive(:update_subscription) end it 'does not create an organization on HubEE' do @@ -77,8 +79,12 @@ end context 'when subscription already exists' do + let(:hubee_subscription_payload) { { 'id' => 123 } } + before do allow(hubee_api_client).to receive(:create_subscription).and_raise(HubEEAPIClient::AlreadyExists) + allow(hubee_api_client).to receive(:find_subscription).and_return(hubee_subscription_payload) + allow(hubee_api_client).to receive(:update_subscription) end it 'does not raise an error' do diff --git a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb index 179e697f0..19e5829bc 100644 --- a/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb +++ b/spec/organizers/datapass_webhook/v2/api_particulier_spec.rb @@ -64,6 +64,12 @@ subject }.not_to have_enqueued_job(CreateFormulaireQFHubEESubscriptionJob) end + + it 'does not schedule a job to create formulaire qf access on HubEE' do + expect { + subject + }.not_to have_enqueued_job(CreateFormulaireQFCollectivityJob) + end end context 'when modalities include formulaire_qf' do @@ -81,6 +87,12 @@ subject }.to have_enqueued_job(CreateFormulaireQFHubEESubscriptionJob) end + + it 'schedules a job to create the collectivity on formulaire qf' do + expect { + subject + }.to have_enqueued_job(CreateFormulaireQFCollectivityJob) + end end context 'when event not approve' do @@ -93,6 +105,12 @@ subject }.not_to have_enqueued_job(CreateFormulaireQFHubEESubscriptionJob) end + + it 'does not schedule a job to create formulaire qf access on HubEE' do + expect { + subject + }.not_to have_enqueued_job(CreateFormulaireQFCollectivityJob) + end end end end From 62e40b2ec4f60d0feb1b0f021924e55f04007018 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Feldis <5403+jbfeldis@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:20:15 +0200 Subject: [PATCH 16/16] Lint discutable --- app/clients/hubee_api_client.rb | 4 ++-- app/interactors/datapass_webhook/adapt_v2_to_v1.rb | 2 +- spec/factories/datapass_webhooks.rb | 2 +- spec/jobs/create_formulaire_qf_collectivity_job_spec.rb | 2 +- spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/clients/hubee_api_client.rb b/app/clients/hubee_api_client.rb index 4b057e44f..c47610d84 100644 --- a/app/clients/hubee_api_client.rb +++ b/app/clients/hubee_api_client.rb @@ -30,7 +30,7 @@ def create_organization(organization, email) raise end - def create_subscription(authorization_request, organization_payload, process_code) + def create_subscription(authorization_request, organization_payload, process_code) # rubocop:disable Metrics/AbcSize http_connection.post( "#{host}/referential/v1/subscriptions", { @@ -67,7 +67,7 @@ def find_subscription(_authorization_request, organization_payload, process_code request.body.first end - def update_subscription(authorization_request, subscription_payload, editor_payload = {}) + def update_subscription(authorization_request, subscription_payload, editor_payload = {}) # rubocop:disable Metrics/AbcSize subscription_id = authorization_request.extra_infos['hubee_subscription_id'] return if subscription_id.blank? diff --git a/app/interactors/datapass_webhook/adapt_v2_to_v1.rb b/app/interactors/datapass_webhook/adapt_v2_to_v1.rb index ec43c9d9f..3130b36e8 100644 --- a/app/interactors/datapass_webhook/adapt_v2_to_v1.rb +++ b/app/interactors/datapass_webhook/adapt_v2_to_v1.rb @@ -23,7 +23,7 @@ def build_data 'scopes' => generic_data['scopes'].index_with { |_scope| true }, 'team_members' => build_team_members, 'events' => [], - 'service_provider' => context.data['service_provider'], + 'service_provider' => context.data['service_provider'] } } end diff --git a/spec/factories/datapass_webhooks.rb b/spec/factories/datapass_webhooks.rb index d2f5163c8..cd813e636 100644 --- a/spec/factories/datapass_webhooks.rb +++ b/spec/factories/datapass_webhooks.rb @@ -69,7 +69,7 @@ 'id' => '3d_ouest', 'type' => 'editor', 'siret' => '44973625500018', - 'code' => '22113', + 'code' => '22113' } end end diff --git a/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb b/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb index e6162f900..90c2744a2 100644 --- a/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb +++ b/spec/jobs/create_formulaire_qf_collectivity_job_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe CreateFormulaireQFCollectivityJob, type: :job do +RSpec.describe CreateFormulaireQFCollectivityJob do describe '#perform' do subject(:job) { described_class.perform_now(authorization_request.id) } diff --git a/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb b/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb index bc1a6a99d..3496d39fb 100644 --- a/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb +++ b/spec/jobs/create_formulaire_qf_hubee_subscription_job_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe CreateFormulaireQFHubEESubscriptionJob, type: :job do +RSpec.describe CreateFormulaireQFHubEESubscriptionJob do describe '#perform' do subject(:create_formulaire_qf_hubee_subscription_job) do described_class.perform_now(authorization_request.id)