-
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-1875 import des fiches rome V4 (#1194)
- Loading branch information
Showing
51 changed files
with
1,671 additions
and
1,646 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
bonnesboites.json | ||
*.xlsx | ||
*SAVE.json | ||
unix_fiche_emploi* |
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
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
import { IFicheMetierRomeV4 } from "shared/models" | ||
|
||
import { Schema, model } from "../../../mongodb" | ||
|
||
export const ficheMetierRomeV4Schema = new Schema<IFicheMetierRomeV4>( | ||
{ | ||
rome_code: { | ||
type: String, | ||
description: "Code Rome", | ||
}, | ||
fiche_metier: { | ||
type: Object, | ||
description: "Fiche metier Rome V4", | ||
}, | ||
}, | ||
{ | ||
versionKey: false, | ||
} | ||
) | ||
|
||
ficheMetierRomeV4Schema.index({ rome_code: 1 }) | ||
ficheMetierRomeV4Schema.index({ "fiche_metier.appellations.code": 1 }) | ||
|
||
export default model<IFicheMetierRomeV4>("ficheMetierRomeV4", ficheMetierRomeV4Schema) |
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
46 changes: 46 additions & 0 deletions
46
server/src/common/model/schema/referentielRome/referentielRome.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,46 @@ | ||
import { IReferentielRome } from "shared/index" | ||
|
||
import { model, Schema } from "../../../mongodb.js" | ||
|
||
const codeRomeSchema = new Schema<string>( | ||
{ code_rome: { type: String, index: true }, intitule: { type: String }, code_ogr: { type: String } }, | ||
{ | ||
_id: false, | ||
versionKey: false, | ||
} | ||
) | ||
|
||
export const referentielRomeSchema = new Schema<IReferentielRome>( | ||
{ | ||
numero: { | ||
type: String, | ||
description: "Numéro d'identification de la fiche emploi", | ||
}, | ||
rome: codeRomeSchema, | ||
appellations: { | ||
type: Array, | ||
items: { | ||
libelle: String, | ||
libelle_court: String, | ||
code_ogr: String, | ||
}, | ||
description: "Liste des appellations lié au code rome", | ||
}, | ||
definition: String, | ||
acces_metier: String, | ||
competences: { | ||
savoir_faire: Array, | ||
savoir_etre_professionnel: Array, | ||
savoirs: Array, | ||
}, | ||
contextes_travail: { | ||
type: Array, | ||
}, | ||
mobilites: { | ||
type: Array, | ||
}, | ||
}, | ||
{ versionKey: false } | ||
) | ||
|
||
export default model<IReferentielRome>("referentielRomes", referentielRomeSchema) |
20 changes: 20 additions & 0 deletions
20
server/src/db/migrations/202404240000000-migrate-referentiel-romes.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,20 @@ | ||
import { Db } from "mongodb" | ||
|
||
import { logger } from "@/common/logger" | ||
|
||
export const up = async (db: Db) => { | ||
await db.collection("recruiters").updateMany( | ||
{}, | ||
{ | ||
$unset: { "jobs.$[].rome_detail": 1 }, | ||
}, | ||
{ | ||
// @ts-expect-error bypassDocumentValidation is not properly set in @types/mongodb | ||
bypassDocumentValidation: true, | ||
} | ||
) | ||
|
||
await db.collection("fichemetierromev3").drop() | ||
|
||
logger.info("20240424000000-rome_details_from_rome_v4") | ||
} |
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
Oops, something went wrong.