Skip to content

Commit

Permalink
fix: correction oubli ajout infos naf pour la création d'un recruteur
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlr committed Aug 22, 2024
1 parent 54aa4e9 commit 41e854f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server/src/services/etablissement.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -748,6 +754,7 @@ export const entrepriseOnboardingWorkflow = {
email: formatedEmail,
status: RECRUITER_STATUS.ACTIF,
jobs: [],
...nafInfo,
},
managingUser._id.toString()
)
Expand Down Expand Up @@ -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),
Expand All @@ -813,6 +827,7 @@ export const entrepriseOnboardingWorkflow = {
origin,
opco,
idcc,
...nafInfo,
},
managedBy
)
Expand Down

0 comments on commit 41e854f

Please sign in to comment.