-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: LBAC-1646 déplacement des candidatures anonymisées dans une aut…
…re collection (#790) * feat: création du modèle avec les champs conservés * feat: ajout schema mongoose * feat: suppression is_anonymized * feat: done * fix: import
- Loading branch information
Showing
4 changed files
with
120 additions
and
44 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
server/src/common/model/schema/application/anonymizedApplications.schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { IAnonymizedApplication } from "shared/models/anonymizedApplications.model" | ||
|
||
import { model, Schema } from "../../../mongodb" | ||
import { mongoosePagination, Pagination } from "../_shared/mongoose-paginate" | ||
|
||
export const anonymizedApplicationSchema = new Schema<IAnonymizedApplication>( | ||
{ | ||
company_recruitment_intention: { | ||
type: String, | ||
default: null, | ||
required: false, | ||
description: "L'intention de la société vis à vis du candidat", | ||
}, | ||
company_feedback_date: { | ||
type: Date, | ||
default: null, | ||
required: false, | ||
description: "Date d'intention/avis donnée", | ||
}, | ||
company_siret: { | ||
type: String, | ||
default: null, | ||
description: "Le siret de l'établissement", | ||
index: true, | ||
}, | ||
company_naf: { | ||
type: String, | ||
default: null, | ||
description: "Le label naf de la société", | ||
}, | ||
job_origin: { | ||
type: String, | ||
default: null, | ||
description: "Le type de société / offre au sens source d'info La bonne alternance. Ex : lba, lbb, matcha, pejob", | ||
}, | ||
job_id: { | ||
type: String, | ||
default: null, | ||
description: "L'id externe de l'offre d'emploi", | ||
index: true, | ||
}, | ||
caller: { | ||
type: String, | ||
default: null, | ||
description: "L'identification de la source d'émission de la candidature (pour widget et api)", | ||
}, | ||
created_at: { | ||
type: Date, | ||
default: Date.now, | ||
description: "La date création de la demande", | ||
}, | ||
}, | ||
{ | ||
versionKey: false, | ||
} | ||
) | ||
|
||
anonymizedApplicationSchema.plugin(mongoosePagination) | ||
|
||
export default model<IAnonymizedApplication, Pagination<IAnonymizedApplication>>("applications", anonymizedApplicationSchema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { extensions } from "../helpers/zodHelpers/zodPrimitives" | ||
import { z } from "../helpers/zodWithOpenApi" | ||
|
||
import { zObjectId } from "./common" | ||
|
||
export const ZAnonymizedApplication = z | ||
.object({ | ||
_id: zObjectId, | ||
company_recruitment_intention: z.string().nullable().describe("L'intention de la société vis à vis du candidat"), | ||
company_feedback_date: z.date().nullable().describe("Date d'intention/avis donnée"), | ||
company_siret: extensions.siret.openapi({ | ||
description: "Le siret de l'entreprise. Fourni par La bonne alternance. ", | ||
example: "00004993900000", | ||
}), | ||
company_naf: z.string().openapi({ | ||
description: "La valeur associée au code NAF de l'entreprise. Fournie par La bonne alternance. ", | ||
example: "Boulangerie et boulangerie-pâtisserie", | ||
}), | ||
job_origin: z.string().nullable().openapi({ | ||
description: "Le type de société selon la nomenclature La bonne alternance. Fourni par La bonne alternance.", | ||
example: "lba|lbb|matcha", | ||
}), | ||
job_id: z.string().nullable().openapi({ | ||
description: | ||
"L'identifiant de l'offre La bonne alternance Recruteur pour laquelle la candidature est envoyée. Seulement si le type de la société (company_type) est \"matcha\" . La valeur est fournie par La bonne alternance. ", | ||
example: "...59c24c059b...", | ||
}), | ||
caller: z.string().nullable().describe("L'identification de la source d'émission de la candidature (pour widget et api)"), | ||
created_at: z.date().nullable().describe("La date création de la demande"), | ||
}) | ||
.strict() | ||
.openapi("Anonymized Application") | ||
|
||
export type IAnonymizedApplication = z.output<typeof ZAnonymizedApplication> |