Checkpoint: Simplification de la classification IA dans l'onglet Veille Stratégique : suppression de la catégorie médico-sociale (Handicap, PA, Enfance, etc.), remplacement de "Générale" par "Informationnelle", classification IA réduite au seul type de veille (réglementaire/concurrentielle/technologique/informationnelle). Migration BDD des données generale → informationnelle. 0 erreur TypeScript, 21 tests passés.
This commit is contained in:
@@ -87,7 +87,7 @@ export const appRouter = router({
|
||||
list: publicProcedure
|
||||
.input(
|
||||
z.object({
|
||||
typeVeille: z.enum(["reglementaire", "concurrentielle", "technologique", "generale"]).optional(),
|
||||
typeVeille: z.enum(["reglementaire", "concurrentielle", "technologique", "informationnelle"]).optional(),
|
||||
categorie: z.string().optional(),
|
||||
niveau: z.string().optional(),
|
||||
territoire: z.string().optional(),
|
||||
@@ -131,15 +131,13 @@ export const appRouter = router({
|
||||
const aiResult = await classifyArticle(
|
||||
row.titre || "",
|
||||
row.resume || "",
|
||||
() => ({ categorie: (row.categorie as any) || "Autre", typeVeille: row.typeVeille || "generale" })
|
||||
() => ({ typeVeille: (row.typeVeille || "informationnelle") as "reglementaire" | "concurrentielle" | "technologique" | "informationnelle" })
|
||||
);
|
||||
await db
|
||||
.update(veilleItems)
|
||||
.set({
|
||||
categorie: aiResult.categorie,
|
||||
typeVeille: (aiResult.typeVeille ?? row.typeVeille ?? "generale") as any,
|
||||
typeVeille: (aiResult.typeVeille ?? row.typeVeille ?? "informationnelle") as any,
|
||||
iaRelevant: aiResult.relevant,
|
||||
iaCategorie: aiResult.categorie,
|
||||
iaClassifiedBy: aiResult.classifiedBy,
|
||||
iaReason: aiResult.reason,
|
||||
})
|
||||
@@ -253,14 +251,12 @@ export const appRouter = router({
|
||||
const aiResult = await classifyArticle(
|
||||
row.titre || "",
|
||||
"",
|
||||
() => ({ categorie: (row.categorie as any) || "Autre", typeVeille: "generale" as const })
|
||||
() => ({ typeVeille: "informationnelle" as const })
|
||||
);
|
||||
await db
|
||||
.update(aapItems)
|
||||
.set({
|
||||
categorie: aiResult.categorie as any,
|
||||
iaRelevant: aiResult.relevant,
|
||||
iaCategorie: aiResult.categorie,
|
||||
iaClassifiedBy: aiResult.classifiedBy,
|
||||
iaReason: aiResult.reason,
|
||||
})
|
||||
@@ -523,7 +519,7 @@ export const appRouter = router({
|
||||
url: z.string().url("URL invalide"),
|
||||
name: z.string().min(1, "Nom requis").max(255),
|
||||
feedType: z.enum(["veille", "aap"]),
|
||||
defaultTypeVeille: z.enum(["reglementaire", "concurrentielle", "technologique", "generale"]).optional(),
|
||||
defaultTypeVeille: z.enum(["reglementaire", "concurrentielle", "technologique", "informationnelle"]).optional(),
|
||||
defaultCategorieAap: z.enum(["Handicap", "PA", "Enfance", "Précarité", "Sanitaire", "Autre"]).optional(),
|
||||
autoRules: z.array(z.object({
|
||||
keyword: z.string(),
|
||||
@@ -551,7 +547,7 @@ export const appRouter = router({
|
||||
url: z.string().url("URL invalide").optional(),
|
||||
name: z.string().min(1).max(255).optional(),
|
||||
feedType: z.enum(["veille", "aap"]).optional(),
|
||||
defaultTypeVeille: z.enum(["reglementaire", "concurrentielle", "technologique", "generale"]).nullable().optional(),
|
||||
defaultTypeVeille: z.enum(["reglementaire", "concurrentielle", "technologique", "informationnelle"]).nullable().optional(),
|
||||
defaultCategorieAap: z.enum(["Handicap", "PA", "Enfance", "Précarité", "Sanitaire", "Autre"]).nullable().optional(),
|
||||
autoRules: z.array(z.object({
|
||||
keyword: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user