Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: familles de métiers #315

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eu
function validate_commit() {
cd .
local sensible_files_pattern="\.(csv|xls|xls(x?)|json|env)$"
local exception="package.json$|tsconfig.json$|server/data/depp(.*).csv$|bcn/n_mef.csv$|server/jsconfig.json$|acce_etablissements.csv$|server/tests/fixtures/files/(.*)$|server/public/remixicon/remixicon.*.json$"
local exception="package.json$|tsconfig.json$|server/data/depp(.*).csv$|server/data/bcn(.*).csv$|bcn/n_mef.csv$|server/jsconfig.json$|acce_etablissements.csv$|server/tests/fixtures/files/(.*)$|server/public/remixicon/remixicon.*.json$"
local files
files=$(git diff --cached --name-only | grep -v -E "$exception" | grep -E "$sensible_files_pattern") || true

Expand Down
21 changes: 21 additions & 0 deletions server/data/bcn/n_famille_metier_spec_pro.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FAMILLE_METIER;LIBELLE_LONG;LIBELLE_EDITION;DATE_OUVERTURE;DATE_FERMETURE;DATE_INTERVENTION;N_COMMENTAIRE
001;CONSTRUCTION DURABLE DU BATIMENT ET DES TRAVAUX PUBLICS;Construction durable du bâtiment et des travaux publics;01/09/2019;;10/02/2020;
002;GESTION ADMINISTRATIVE, DU TRANSPORT ET DE LA LOGISTIQUE;Gestion administrative, du transport et de la logistique;01/09/2019;;10/02/2020;
003;RELATION CLIENT;Relation client;01/09/2019;;10/02/2020;
004;MER;Mer;01/09/2019;;10/02/2020;
999;SPECIALITE HORS FAMILLE DE METIERS;Spécialité hors famille de métiers;01/09/2019;;10/02/2020;
005;INDUSTRIES GRAPHIQUES ET COMMUNICATION;Industries graphiques et communication;01/09/2020;;17/03/2020;
006;ALIMENTATION;Alimentation;01/09/2020;;17/03/2020;
007;BEAUTE ET BIEN-ETRE;Beauté et bien-être;01/09/2020;;17/03/2020;
008;ETUDES ET MODELISATION NUMERIQUE DU BATIMENT;Etudes et modélisation numérique du bâtiment;01/09/2020;;17/03/2020;
009;AERONAUTIQUE;Aéronautique;01/09/2020;;17/03/2020;
010;HOTELLERIE-RESTAURATION;Hôtellerie-restauration;01/09/2020;;17/03/2020;
011;MAINTENANCE DES MATERIELS ET DES VEHICULES;Maintenance des matériels et des véhicules;01/09/2021;;21/05/2021;
012;REALISATION D'ENSEMBLES MECANIQUES ET INDUSTRIELS;Réalisation d'ensembles mécaniques et industriels;01/09/2021;;21/05/2021;
013;AGENCEMENT, MENUISERIE ET AMEUBLEMENT;Agencement, menuiserie et ameublement;01/09/2021;;21/05/2021;
014;TRANSITIONS NUMERIQUE ET ENERGETIQUE;Transitions numérique et énergétique;01/09/2021;;21/05/2021;
015;PILOTAGE ET MAINTENANCE D'INSTALLATIONS AUTOMATISEES;Pilotage et maintenance d'installations automatisées;01/09/2021;;21/05/2021;
016_temp;NATURE - JARDIN - PAYSAGE - FORET;Nature - jardin - paysage - forêt;;;;
017_temp;ALIMENTATION-BIO-INDUSTRIE-LABORATOIRE;Alimentation-bio-industrie-laboratoire;;;;
018_temp;PRODUCTIONS;Productions;;;;
019_temp;CONSEIL VENTE;Conseil vente;;;;
276 changes: 276 additions & 0 deletions server/data/bcn/n_lien_mef_famille_metier.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
FAMILLE_METIER;MEF;DATE_OUVERTURE;DATE_FERMETURE;DATE_INTERVENTION;N_COMMENTAIRE;tag
001;2472000631;01/09/2019;;26/04/2023;;2NDE PRO COMMUNE
018_temp;2762111432;01/09/2019;;31/01/2019;;
019_temp;2762120333;01/09/2011;;19/07/2013;;
018_temp;2762111433;01/09/2020;;31/01/2019;;
018_temp;2762121032;01/09/2011;;19/07/2013;;
016_temp;2762130332;01/09/2011;;19/07/2013;;
019_temp;2762120332;01/09/2010;;19/07/2013;;
018_temp;2762121133;01/09/2013;;19/07/2013;;
016_temp;2762130333;01/09/2012;;19/07/2013;;
018_temp;2762121033;01/09/2012;;19/07/2013;;
019_temp;2762210331;01/09/2009;;05/04/2021;;2NDE PRO COMMUNE
017_temp;2762210431;01/09/2009;;05/04/2021;;2NDE PRO COMMUNE
018_temp;2762100132;01/09/2010;;19/07/2013;;
018_temp;2762100133;01/09/2011;;19/07/2013;;
016_temp;2762130232;01/09/2010;;19/07/2013;;
017_temp;2762210532;01/09/2010;;19/07/2013;;
016_temp;2762140532;01/09/2010;;19/07/2013;;
016_temp;2762130233;01/09/2011;;19/07/2013;;
017_temp;2762210533;01/09/2011;;19/07/2013;;
016_temp;2762140533;01/09/2011;;19/07/2013;;
018_temp;2762100432;01/09/2017;;30/03/2017;;
018_temp;2762100433;01/09/2018;;30/03/2017;;
018_temp;2762111333;01/09/2018;;30/03/2017;;
018_temp;2762111332;01/09/2017;;30/03/2017;;
018_temp;2762111231;01/09/2016;;05/04/2021;;2NDE PRO COMMUNE
009;2472530432;01/09/2014;;28/02/2020;;
009;2472530332;01/09/2014;;28/02/2020;;
016_temp;2762140431;01/09/2009;;05/04/2021;;2NDE PRO COMMUNE
009;2472530532;01/09/2014;;28/02/2020;;
009;2472530233;01/09/2015;;11/05/2021;;
009;2472530433;01/09/2015;;11/05/2021;;
009;2472530333;01/09/2015;;11/05/2021;;
009;2472530533;01/09/2015;;11/05/2021;;
012;2472230333;01/09/2011;;26/04/2023;;
019_temp;2762140733;01/09/2021;;03/04/2020;;
019_temp;2762140732;01/09/2020;;03/04/2020;;
004;2472501133;01/09/2021;;26/04/2023;;
009;2472530232;01/09/2014;;28/02/2020;;
010;2472210632;01/09/2012;;26/04/2023;;
018_temp;2762120433;01/09/2011;31/08/2024;25/03/2022;;
018_temp;2762120432;01/09/2010;31/08/2023;25/03/2022;;
019_temp;2762210833;01/09/2022;;05/05/2022;;
019_temp;2762210832;01/09/2021;;05/05/2022;;
018_temp;2762121132;01/09/2012;;15/09/2022;;
014;2472551932;01/09/2024;;26/04/2023;;
006;2472210533;01/09/2010;;26/04/2023;;
001;2472330433;01/09/2008;;26/04/2023;;
012;2472500632;01/09/2008;;26/04/2023;;
012;2472500633;01/09/2008;;26/04/2023;;
001;2472540632;01/09/2008;;26/04/2023;;
001;2472540633;01/09/2008;;26/04/2023;;
013;2472340732;01/09/2008;;26/04/2023;;
015;2472340632;01/09/2008;;26/04/2023;;
008;2472300432;01/09/2008;;26/04/2023;;
008;2472300532;01/09/2008;;26/04/2023;;
001;2472320332;01/09/2008;;26/04/2023;;
008;2472310332;01/09/2008;;26/04/2023;;
013;2472340532;01/09/2008;;26/04/2023;;
012;2472510832;01/09/2008;;26/04/2023;;
012;2472510833;01/09/2008;;26/04/2023;;
001;2472310232;01/09/2008;31/08/2024;26/04/2023;;
004;2472501033;01/09/2021;;26/04/2023;;
001;2472330333;01/09/2008;;26/04/2023;;
013;2472340733;01/09/2008;;26/04/2023;;
015;2472340633;01/09/2008;;26/04/2023;;
001;2472320333;01/09/2008;;26/04/2023;;
008;2472310333;01/09/2008;;26/04/2023;;
013;2472340533;01/09/2008;;26/04/2023;;
004;2473111233;01/09/2021;;26/04/2023;;
014;2472270632;01/09/2022;;26/04/2023;;
007;2473360432;01/09/2021;;26/04/2023;;
014;2472551732;01/09/2022;;26/04/2023;;
012;2472501432;01/09/2022;;26/04/2023;;
004;2473111333;01/09/2021;;26/04/2023;;
014;2472270732;01/09/2022;;26/04/2023;;
014;2472270733;01/09/2023;;26/04/2023;;
014;2472270633;01/09/2023;;26/04/2023;;
007;2473360433;01/09/2022;;26/04/2023;;
011;2472522231;01/09/2021;;26/04/2023;;2NDE PRO COMMUNE
014;2472551733;01/09/2023;;26/04/2023;;
012;2472501332;01/09/2022;;26/04/2023;;
012;2472501333;01/09/2023;;26/04/2023;;
012;2472501433;01/09/2023;;26/04/2023;;
004;2473111332;01/09/2020;;26/04/2023;;
004;2472130432;01/09/2020;;26/04/2023;;
004;2472501032;01/09/2020;;26/04/2023;;
011;2472521932;01/09/2017;;26/04/2023;;
011;2472521933;01/09/2018;;26/04/2023;;
011;2472522033;01/09/2018;;26/04/2023;;
011;2472522133;01/09/2018;;26/04/2023;;
007;2473360531;01/09/2020;;26/04/2023;;2NDE PRO COMMUNE
009;2472530731;01/09/2020;;26/04/2023;;2NDE PRO COMMUNE
013;2472340931;01/09/2021;;26/04/2023;;2NDE PRO COMMUNE
006;2472210731;01/09/2020;;26/04/2023;;2NDE PRO COMMUNE
004;2472000731;01/09/2019;;26/04/2023;;2NDE PRO COMMUNE
012;2472010331;01/09/2021;;26/04/2023;;2NDE PRO COMMUNE
010;2473340431;01/09/2020;;26/04/2023;;2NDE PRO COMMUNE
008;2472300731;01/09/2020;;26/04/2023;;2NDE PRO COMMUNE
005;2473221031;01/09/2020;;26/04/2023;;2NDE PRO COMMUNE
015;2472010431;01/09/2021;;26/04/2023;;2NDE PRO COMMUNE
015;2472010233;01/09/2014;;26/04/2023;;
004;2472501132;01/09/2020;;26/04/2023;;
012;2472541132;01/09/2019;;26/04/2023;;
012;2472541133;01/09/2020;;26/04/2023;;
012;2472230332;01/09/2010;;26/04/2023;;
011;2472522032;01/09/2017;;26/04/2023;;
011;2472522132;01/09/2017;;26/04/2023;;
011;2472521432;01/09/2015;;26/04/2023;;
011;2472521433;01/09/2016;;26/04/2023;;
011;2472521532;01/09/2015;;26/04/2023;;
011;2472521533;01/09/2016;;26/04/2023;;
011;2472521632;01/09/2015;;26/04/2023;;
011;2472521633;01/09/2016;;26/04/2023;;
014;2472551032;01/09/2017;;26/04/2023;;
005;2473220833;01/09/2016;;26/04/2023;;
005;2473220732;01/09/2015;;26/04/2023;;
005;2473220733;01/09/2016;;26/04/2023;;
001;2472320532;01/09/2014;;26/04/2023;;
001;2472320533;01/09/2015;;26/04/2023;;
001;2472320632;01/09/2014;;26/04/2023;;
001;2472320633;01/09/2015;;26/04/2023;;
001;2472320732;01/09/2014;;26/04/2023;;
001;2472320733;01/09/2015;;26/04/2023;;
015;2472010232;01/09/2013;;26/04/2023;;
015;2472200432;01/09/2013;;26/04/2023;;
015;2472200433;01/09/2014;;26/04/2023;;
005;2473220832;01/09/2015;;26/04/2023;;
006;2472210432;01/09/2010;;26/04/2023;;
006;2472210532;01/09/2010;;26/04/2023;;
010;2473340332;01/09/2012;;26/04/2023;;
010;2473340333;01/09/2013;;26/04/2023;;
010;2472210633;01/09/2013;;26/04/2023;;
013;2472340832;01/09/2012;;26/04/2023;;
013;2472340833;01/09/2013;;26/04/2023;;
005;2473220632;01/09/2012;;26/04/2023;;
005;2473220633;01/09/2013;;26/04/2023;;
006;2473120932;01/09/2010;;26/04/2023;;
001;2472330432;01/09/2008;;26/04/2023;;
006;2472210433;01/09/2010;;26/04/2023;;
001;2472330332;01/09/2008;;26/04/2023;;
006;2473120933;01/09/2010;;26/04/2023;;
008;2472300433;01/09/2009;;26/04/2023;;
008;2472300533;01/09/2009;;26/04/2023;;
012;2472230232;01/09/2000;;26/04/2023;;
012;2472230233;01/09/2000;;26/04/2023;;
002;2473000433;01/09/2022;;26/04/2023;;
002;2473110632;01/09/2010;;26/04/2023;;
003;2473121232;01/09/2020;;26/04/2023;;
003;2473121233;01/09/2021;;26/04/2023;;
003;2473121131;01/09/2019;;26/04/2023;;2NDE PRO COMMUNE
014;2472551033;01/09/2018;;26/04/2023;;
003;2473121332;01/09/2020;;26/04/2023;;
003;2473121333;01/09/2021;;26/04/2023;;
003;2473121432;01/09/2020;;26/04/2023;;
003;2473121433;01/09/2021;;26/04/2023;;
002;2473111432;01/09/2021;;26/04/2023;;
002;2473111433;01/09/2022;;26/04/2023;;
002;2473110633;01/09/2011;;26/04/2023;;
007;2473360632;01/09/2023;;26/04/2023;;
007;2473360633;01/09/2024;;26/04/2023;;
002;2473000331;01/09/2019;;26/04/2023;;2NDE PRO COMMUNE
014;2472000831;01/09/2021;;26/04/2023;;2NDE PRO COMMUNE
015;2472501233;01/09/2023;;26/04/2023;;
001;2472310233;01/09/2008;31/08/2025;26/04/2023;;
002;2473000432;01/09/2021;;26/04/2023;;
004;2473111232;01/09/2020;;26/04/2023;;
015;2472501232;01/09/2022;;26/04/2023;;
017_temp;2472200332;01/09/2010;31/08/2024;25/05/2023;;
017_temp;2472200333;01/09/2011;31/08/2025;25/05/2023;;
004;2472130433;01/09/2021;;26/04/2023;;
001;2472321032;01/09/2023;;21/05/2024;;
001;2472321033;01/09/2023;;21/05/2024;;
001;2472321031;01/09/2023;;21/05/2024;;
007;2473360631;01/09/2022;;21/05/2024;;
008;2472310431;01/09/2024;;31/05/2024;;
008;2472310432;01/09/2024;;31/05/2024;;
008;2472310433;01/09/2024;;31/05/2024;;
014;2472552031;01/09/2024;;31/05/2024;;
014;2472552032;01/09/2024;;31/05/2024;;
014;2472552033;01/09/2024;;31/05/2024;;
001;2452310211;01/09/2005;31/08/2025;21/05/2024;;
001;2462310221;01/09/2005;31/08/2025;21/05/2024;;
001;2462310222;01/09/2005;31/08/2025;21/05/2024;;
001;2472310231;01/09/2005;31/08/2025;21/05/2024;;
001;2462320321;01/09/2007;;21/05/2024;;
001;2462320322;01/09/2007;;21/05/2024;;
001;2452320311;01/09/2007;;21/05/2024;;
001;2472320331;01/09/2007;;21/05/2024;;
001;2472320531;01/09/2014;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
001;2472320631;01/09/2014;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
001;2472320731;01/09/2014;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
001;2452330311;01/09/2006;;21/05/2024;;
001;2462330321;01/09/2006;;21/05/2024;;
001;2462330322;01/09/2006;;21/05/2024;;
001;2472330331;01/09/2006;;21/05/2024;;
001;2452330411;01/09/2006;;21/05/2024;;
001;2462330421;01/09/2006;;21/05/2024;;
001;2462330422;01/09/2006;;21/05/2024;;
001;2472330431;01/09/2006;;21/05/2024;;
001;2452540611;01/09/2006;;21/05/2024;;
001;2462540621;01/09/2006;;21/05/2024;;
001;2462540622;01/09/2006;;21/05/2024;;
001;2472540631;01/09/2006;;21/05/2024;;
007;2473360332;01/09/2017;31/08/2024;19/04/2022;;
007;2473360331;01/09/2017;31/08/2024;19/04/2022;;
007;2473360333;01/09/2017;31/08/2024;19/04/2022;;
007;2473360431;01/09/2020;;21/05/2024;;
009;2472530231;01/09/2013;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
009;2472530331;01/09/2013;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
009;2472530431;01/09/2013;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
009;2472530531;01/09/2013;;21/05/2024;;
013;2452340511;01/09/2005;;21/05/2024;;
013;2462340521;01/09/2005;;21/05/2024;;
013;2462340522;01/09/2005;;21/05/2024;;
013;2472340531;01/09/2005;;21/05/2024;;
013;2462340722;01/09/2006;;21/05/2024;;
013;2452340711;01/09/2006;;21/05/2024;;
013;2462340721;01/09/2006;;21/05/2024;;
013;2472340731;01/09/2006;;21/05/2024;;
013;2472340831;01/09/2011;;21/05/2024;;
006;2472210431;01/09/2009;;21/05/2024;;
006;2472210531;01/09/2009;;21/05/2024;;
006;2473120931;01/09/2009;;21/05/2024;;
012;2472230331;01/09/2009;;21/05/2024;;
012;2452500611;01/09/2004;;21/05/2024;;
012;2462500621;01/09/2004;;21/05/2024;;
012;2462500622;01/09/2004;;21/05/2024;;
012;2472500631;01/09/2004;;21/05/2024;;
012;2452510811;01/09/2004;;21/05/2024;;
012;2462510821;01/09/2004;;21/05/2024;;
012;2462510822;01/09/2004;;21/05/2024;;
012;2472510831;01/09/2004;;21/05/2024;;
012;2472541131;01/09/2018;;21/05/2024;;
012;2462230221;01/09/1999;;21/05/2024;;
012;2452230211;01/09/1999;;21/05/2024;;
012;2462230222;01/09/1999;;21/05/2024;;
012;2472230231;01/09/1999;;21/05/2024;;
012;2472501331;01/09/2021;;21/05/2024;;
012;2472501431;01/09/2021;;21/05/2024;;
010;2472210631;01/09/2011;;21/05/2024;;
010;2473340331;01/09/2011;;21/05/2024;;
008;2452300411;01/09/2008;;21/05/2024;;
008;2462300421;01/09/2008;;21/05/2024;;
008;2462300422;01/09/2008;;21/05/2024;;
008;2472300431;01/09/2008;;21/05/2024;;
008;2452300511;01/09/2008;;21/05/2024;;
008;2462300521;01/09/2008;;21/05/2024;;
008;2462300522;01/09/2008;;21/05/2024;;
008;2472300531;01/09/2008;;21/05/2024;;
008;2462310321;01/09/2007;31/08/2026;31/05/2024;;
008;2462310322;01/09/2007;31/08/2026;31/05/2024;;
008;2452310311;01/09/2007;31/08/2026;31/05/2024;;
008;2472310331;01/09/2007;31/08/2026;31/05/2024;;
005;2473220631;01/09/2011;;21/05/2024;;
005;2473220731;01/09/2014;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
005;2473220831;01/09/2014;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
015;2472010231;01/09/2012;;21/05/2024;octobre 2014 : renseignement colonne CITE_DOMAINE_FORMATION;
015;2472200431;01/09/2012;;21/05/2024;01/10/2014 : complément de cite_domaine_formation;
015;2452340611;01/09/2006;;21/05/2024;;
015;2462340621;01/09/2006;;21/05/2024;;
015;2462340622;01/09/2006;;21/05/2024;;
015;2472340631;01/09/2006;;21/05/2024;;
015;2472501231;01/09/2021;;21/05/2024;;
003;2473121331;01/09/2019;;21/05/2024;;
003;2473121431;01/09/2019;;21/05/2024;;
003;2473121231;01/09/2019;;21/05/2024;;
002;2473000431;01/09/2020;;21/05/2024;;
002;2473110631;01/09/2010;;21/05/2024;;
002;2473111431;01/09/2020;;21/05/2024;;
014;2472551031;01/09/2016;31/08/2025;31/05/2024;;
014;2472551933;01/09/2023;;21/05/2024;;
014;2472551931;01/09/2023;;21/05/2024;;
014;2472270731;01/09/2021;;21/05/2024;;
014;2472270631;01/09/2021;;21/05/2024;;
014;2472551731;01/09/2021;;21/05/2024;;
51 changes: 51 additions & 0 deletions server/migrations/20241202124638-ajout_des_familles_de_métiers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { omit, without, uniq } from "lodash-es";
import { boolean, string, object } from "#src/common/db/collections/jsonSchema/jsonSchemaTypes.js";
import * as MongoDB from "#src/common/db/mongodb.js";

const schema = {
properties: {
familleMetier: object(
{
code: string(),
libelle: string(),
isAnneeCommune: boolean(),
},
{ required: ["code", "libelle", "isAnneeCommune"] }
),
},
required: [],
};

export const up = async (db, client) => {
MongoDB.setMongoDBClient(client);
await Promise.all([MongoDB.mergeSchema("bcn", schema)]);
};

export const down = async (db, client) => {
return Promise.all(
["bcn"].map(async (collection) => {
const collectionInfos = await db.listCollections({ name: collection }).toArray();
const validator = collectionInfos[0].options.validator;

if (!validator) {
return;
}

const oldSchema = validator.$jsonSchema;
const newSchema = {
...oldSchema,
properties: omit(oldSchema.properties, Object.keys(schema.properties)),
required: uniq(without(oldSchema.required || [], ...schema.required)),
};

return db.command({
collMod: collection,
validationLevel: "strict",
validationAction: "error",
validator: {
$jsonSchema: newSchema,
},
});
})
);
};
Loading
Loading