Skip to content

Commit

Permalink
Merge pull request #497 from mission-apprentissage/feat/formations-sp…
Browse files Browse the repository at this point in the history
…ecifiques

feat: formations specifiques
  • Loading branch information
LucasDetre authored Dec 18, 2024
2 parents 2bffc30 + bd54599 commit edf8033
Show file tree
Hide file tree
Showing 139 changed files with 3,036 additions and 2,072 deletions.
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ fileignoreconfig:
checksum: d42601745f99f191e3fb865ed61ef829e4c7e82a5d157a544deb8f4986717fef
- filename: ui/app/(wrapped)/documentation/page.tsx
checksum: 50bc89c2ce7e01f8b8ff7381b44abb68ed2979230dc7252009e2e77b85c11558
- filename: ui/app/(wrapped)/glossaire/GlossaireEntries.ts
checksum: 879121c075cb8d6f1bb728ed24706ea5c31b20bc7a0ba1d20747237ddbe42ec5
- filename: ui/app/(wrapped)/mentions-legales/page.tsx
checksum: 9d41bf20ab3cb269091a285eefeae595ecfd38dad78dbda7859eef31e69e7bc7
- filename: ui/app/(wrapped)/politique-de-confidentialite/page.tsx
Expand Down
12 changes: 8 additions & 4 deletions server/src/commands.product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { basepath } from "./basepath";
import { createUser } from "./modules/core/usecases/createUser/createUser.usecase";
import type { LineTypes } from "./modules/import/repositories/rawData.repository";
import { Schemas } from "./modules/import/repositories/rawData.repository";
import { importActionPrioritaire } from "./modules/import/usecases/importActionPrioritaire/importActionPrioritaire.usecase";
import { importConstatRentree } from "./modules/import/usecases/importConstatRentree/importConstatRentree.usecase";
import { importDataEtablissements } from "./modules/import/usecases/importDataEtablissements/importDataEtablissements.usecase";
import { importDataFormations } from "./modules/import/usecases/importDataFormations/importDataFormations.usecase";
Expand Down Expand Up @@ -110,7 +111,6 @@ export function productCommands(cli: Command) {
.command("importFiles")
.argument("[filename]")
.action(async (filename?: string) => {
console.log(filename);
const getImport = async ({
type,
year,
Expand All @@ -121,7 +121,6 @@ export function productCommands(cli: Command) {
schema: Zod.Schema<unknown>;
}) => {
const filePath = year ? `${basepath}/files/${year}/${type}_${year}.csv` : `${basepath}/files/${type}.csv`;
console.log(filePath);
return await importRawFile({
type: year ? `${type}_${year}` : type,
path: filePath,
Expand Down Expand Up @@ -247,6 +246,10 @@ export function productCommands(cli: Command) {
type: "tension_rome_departement",
schema: Schemas.tension_rome_departement,
}),
...getImports({
type: "actions_prioritaires",
schema: Schemas.actions_prioritaires,
}),
};

await writeErrorLogs({
Expand Down Expand Up @@ -299,7 +302,7 @@ export function productCommands(cli: Command) {
importTensionRomeNational,
importTensionRomeRegion,
importTensionRomeDepartement,
refreshViews,
importActionPrioritaire,
};

if (usecaseName) {
Expand All @@ -309,6 +312,7 @@ export function productCommands(cli: Command) {
await usecase();
}
}
await refreshViews();
});

cli.command("refreshViews").action(async () => {
Expand All @@ -325,7 +329,6 @@ export function productCommands(cli: Command) {
.action(async (usecaseName: string) => {
const usecases = {
importFormations,
refreshViews,
importPositionsQuadrant,
};

Expand All @@ -336,6 +339,7 @@ export function productCommands(cli: Command) {
await usecase();
}
}
await refreshViews();
});

cli
Expand Down
4 changes: 2 additions & 2 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config = {
publicUrl,
apiPublicUrl: environement === "local" ? "http://localhost:5001/api" : `${publicUrl}/api`,
log: {
type: env.get("LOG_TYPE").required().asString(),
type: env.get("LOG_TYPE").asString(),
level: env.get("LOG_LEVEL").required().asString(),
forceLocalLogs: env.get("LOG_LOCAL").asBool(),
},
Expand All @@ -33,7 +33,7 @@ const config = {
.get("PSQL_CA")
.required(environement === "production")
.asString(),
logLevel: env.get("PSQL_LOG_LEVEL").required().asString(),
logLevel: env.get("PSQL_LOG_LEVEL").asString(),
},
auth: {
authJwtSecret: env.get("AUTH_JWT_SECRET").required().asString(),
Expand Down
11 changes: 11 additions & 0 deletions server/src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export interface Academie {
codeRegion: string;
}

export interface ActionPrioritaire {
id: Generated<string>;
cfd: string;
codeRegion: string;
codeDispositif: string;
}

export interface Avis {
id: Generated<string>;
createdBy: string | null;
Expand Down Expand Up @@ -417,6 +424,9 @@ export interface FormationNonMaterializedView {
typeFamille: "1ere_commune" | "2nde_commune" | "option" | "specialite" | null;
voie: string | null;
codeNsf: string | null;
isTransitionNumerique: boolean | null;
isTransitionEcologique: boolean | null;
isTransitionDemographique: boolean | null;
}

export interface FormationRome {
Expand Down Expand Up @@ -898,6 +908,7 @@ export interface User {

export interface DB {
academie: Academie;
actionPrioritaire: ActionPrioritaire;
avis: Avis;
campagne: Campagne;
changeLog: ChangeLog;
Expand Down
6 changes: 5 additions & 1 deletion server/src/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ import * as migration_1729693085251 from "./migration_1729693085251";
import * as migration_1730888921742 from "./migration_1730888921742";
import * as migration_1731666807035 from "./migration_1731666807035";
import * as migration_1733743141284 from "./migration_1733743141284";
import * as migration_1734527074984 from "./migration_1734527074984";
import * as migration_1734527078957 from "./migration_1734527078957";

type Migration = {
up: (db: Kysely<any>) => Promise<void>;
Expand Down Expand Up @@ -193,8 +195,10 @@ export const migrations: Migrations = {
migration_1727438989073,
migration_1727692347950,
migration_1727790113090,
migration_1730888921742,
migration_1729693085251,
migration_1730888921742,
migration_1731666807035,
migration_1733743141284,
migration_1734527074984,
migration_1734527078957,
};
Loading

0 comments on commit edf8033

Please sign in to comment.