From 41e854f62e34c76c8830bc744b162213c2a9e8a1 Mon Sep 17 00:00:00 2001 From: Alan Le Ruyet Date: Thu, 22 Aug 2024 14:18:57 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20correction=20oubli=20ajout=20infos=20naf?= =?UTF-8?q?=20pour=20la=20cr=C3=A9ation=20d'un=20recruteur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/services/etablissement.service.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/src/services/etablissement.service.ts b/server/src/services/etablissement.service.ts index c3244568c7..9f1343f397 100644 --- a/server/src/services/etablissement.service.ts +++ b/server/src/services/etablissement.service.ts @@ -736,6 +736,12 @@ export const entrepriseOnboardingWorkflow = { validated = result.validated } + const nafInfo: { naf_code?: string | null; naf_label?: string | null } = {} + if ("naf_label" in siretResponse) { + nafInfo.naf_label = siretResponse.naf_label + nafInfo.naf_code = siretResponse.naf_code + } + const formulaire = await createFormulaire( { ...entrepriseToRecruiter(entreprise), @@ -748,6 +754,7 @@ export const entrepriseOnboardingWorkflow = { email: formatedEmail, status: RECRUITER_STATUS.ACTIF, jobs: [], + ...nafInfo, }, managingUser._id.toString() ) @@ -799,6 +806,13 @@ export const entrepriseOnboardingWorkflow = { if (opco) { await updateEntrepriseOpco(siret, { opco, idcc: idcc ?? undefined }) } + + const nafInfo: { naf_code?: string | null; naf_label?: string | null } = {} + if ("naf_label" in siretResponse) { + nafInfo.naf_label = siretResponse.naf_label + nafInfo.naf_code = siretResponse.naf_code + } + const formulaireInfo = await createFormulaire( { ...entrepriseToRecruiter(entreprise), @@ -813,6 +827,7 @@ export const entrepriseOnboardingWorkflow = { origin, opco, idcc, + ...nafInfo, }, managedBy )