diff --git a/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap b/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap index e59d1c7b2..ea1001ee3 100644 --- a/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap +++ b/shared/helpers/openapi/__snapshots__/generateOpenapi.test.ts.snap @@ -3472,6 +3472,290 @@ exports[`generateOpenApiSchema > should generate proper schema 1`] = ` }, "openapi": "3.1.0", "paths": { + "/application": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "applicant_attachment_content": { + "description": "Le contenu du fichier du CV du candidat. La taille maximale autorisée est de 3 Mo.", + "maxLength": 4215276, + "type": "string", + }, + "applicant_attachment_name": { + "description": "Nom du fichier du CV du candidat. Seuls les .docx et .pdf sont autorisés.", + "minLength": 1, + "pattern": "((.*?))(\\.)+([Dd][Oo][Cc][Xx]|[Pp][Dd][Ff])$", + "type": "string", + }, + "applicant_email": { + "description": "Email du candidat", + "format": "email", + "type": "string", + }, + "applicant_first_name": { + "description": "Prenom du candidat", + "maxLength": 50, + "minLength": 1, + "type": "string", + }, + "applicant_last_name": { + "description": "Nom du candidat", + "maxLength": 50, + "minLength": 1, + "type": "string", + }, + "applicant_message": { + "description": "Un message du candidat vers le recruteur. Ce champ peut contenir la lettre de motivation du candidat.", + "type": [ + "string", + "null", + ], + }, + "applicant_phone": { + "description": "Téléphone du candidat", + "type": "string", + }, + "caller": { + "description": "L'identification de la source d'émission de la candidature (pour widget et api)", + "type": [ + "string", + "null", + ], + }, + "job_searched_by_user": { + "description": "Métier recherché par le candidat", + "type": [ + "string", + "null", + ], + }, + "recipient_id": { + "description": "Identifiant unique de la ressource vers laquelle la candidature est faite, préfixé par le nom de la collection", + "type": "string", + }, + }, + "required": [ + "applicant_first_name", + "applicant_last_name", + "applicant_email", + "applicant_phone", + "applicant_attachment_name", + "applicant_attachment_content", + "recipient_id", + ], + "type": "object", + }, + }, + }, + "required": true, + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + }, + }, + "required": [ + "id", + ], + "type": "object", + }, + }, + }, + "description": "", + }, + }, + "security": [ + { + "api-apprentissage": [], + }, + ], + "tags": [ + "V2 - Application", + ], + }, + }, + "/appointment": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "parcoursup_id": { + "type": "string", + }, + "referrer": { + "enum": [ + "parcoursup", + ], + "type": "string", + }, + }, + "required": [ + "parcoursup_id", + "referrer", + ], + "type": "object", + }, + { + "additionalProperties": false, + "properties": { + "onisep_id": { + "description": "Identifiant ONISEP utilisé avec le mapping de la collection referentielonisep", + "type": "string", + }, + "referrer": { + "enum": [ + "onisep", + ], + "type": "string", + }, + }, + "required": [ + "onisep_id", + "referrer", + ], + "type": "object", + }, + { + "additionalProperties": false, + "properties": { + "cle_ministere_educatif": { + "type": "string", + }, + "referrer": { + "enum": [ + "parcoursup", + "lba", + "onisep", + "jeune_1_solution", + "affelnet", + ], + "type": "string", + }, + }, + "required": [ + "cle_ministere_educatif", + "referrer", + ], + "type": "object", + }, + ], + }, + }, + }, + "required": true, + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "cfd": { + "description": "Code formation diplôme de la formation", + "type": "string", + }, + "cle_ministere_educatif": { + "description": "Identifiant unique de la formation au sein du ministère de l'éducation", + "type": "string", + }, + "code_postal": { + "description": "Code postal du lieu de formation", + "type": "string", + }, + "etablissement_formateur_entreprise_raison_sociale": { + "description": "Raison social de l'établissement formateur", + "type": [ + "string", + "null", + ], + }, + "etablissement_formateur_siret": { + "description": "Le numéro de SIRET de l'établissement", + "example": "78424186100011", + "pattern": "^\\d{14}$", + "type": [ + "string", + "null", + ], + }, + "form_url": { + "description": "Lien de prise de rendez-vous La bonne alternance", + "type": "string", + }, + "intitule_long": { + "description": "Intitulé long de la formation", + "type": "string", + }, + "lieu_formation_adresse": { + "description": "Adresse du lieu de formation", + "type": "string", + }, + "localite": { + "description": "Localité du lieu de formation", + "type": "string", + }, + }, + "required": [ + "etablissement_formateur_entreprise_raison_sociale", + "intitule_long", + "lieu_formation_adresse", + "code_postal", + "etablissement_formateur_siret", + "cfd", + "localite", + "cle_ministere_educatif", + "form_url", + ], + "type": "object", + }, + { + "properties": { + "error": { + "enum": [ + "Appointment request not available", + ], + "type": "string", + }, + }, + "required": [ + "error", + ], + "type": "object", + }, + ], + }, + }, + }, + "description": "", + }, + }, + "security": [ + { + "api-apprentissage": [], + }, + ], + "tags": [ + "V2 - Appointment", + ], + }, + }, "/appointment-request/context/create": { "post": { "description": "Appointment request", diff --git a/shared/routes/application.routes.v2.ts b/shared/routes/application.routes.v2.ts index 8cdd3c9a7..699da1a91 100644 --- a/shared/routes/application.routes.v2.ts +++ b/shared/routes/application.routes.v2.ts @@ -15,6 +15,9 @@ export const zApplicationRoutesV2 = { }), }, securityScheme: { auth: "api-apprentissage", access: "api-apprentissage:applications", resources: {} }, + openapi: { + tags: ["V2 - Application"] as string[], + }, }, "/_private/application": { path: "/_private/application", diff --git a/shared/routes/appointments.routes.v2.ts b/shared/routes/appointments.routes.v2.ts index c4f466155..31ce4bf58 100644 --- a/shared/routes/appointments.routes.v2.ts +++ b/shared/routes/appointments.routes.v2.ts @@ -78,6 +78,9 @@ export const zAppointmentsRouteV2 = { "200": ZAppointmentResponseSchema, }, securityScheme: { auth: "api-apprentissage", access: "api-apprentissage:appointment", resources: {} }, + openapi: { + tags: ["V2 - Appointment"] as string[], + }, }, }, } as const satisfies IRoutesDef