mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-19 05:06:56 +02:00
feat: implement AI Copilot for product analysis, featuring dedicated API, business logic, UI components, and comprehensive documentation.
This commit is contained in:
1 parent
7a6b515db7
commit
1c03403e9a
8 files changed
+229
-11
No files matched your search
@@ -38,9 +38,15 @@ CONTRIBUTION(%) :
|
||||
GARDES-FOUS : ${p.scoring.isTop30Supplier ? "Oui (Top 30% Fournisseur)" : "Non"} | Récent : ${p.scoring.isRecent ? "Oui" : "Non"} | Dernier Prod: ${p.scoring.isLastProduct ? "Oui" : "Non"}
|
||||
` : "";
|
||||
|
||||
const contextRules = p.supplierContext ? `
|
||||
--- RÈGLES MÉTIER SPÉCIFIQUES ---
|
||||
Le manager a défini ces règles absolues pour ce fournisseur (TU DOIS LES RESPECTER EN PRIORITÉ) :
|
||||
"${p.supplierContext}"
|
||||
` : "";
|
||||
|
||||
return `PRODUIT: ${p.libelle1} (${p.codein})
|
||||
PERFORMANCE: Score Global ${p.score.toFixed(1)}/100 | Marge ${p.tauxMarge.toFixed(1)}% | PMV ${pmv.toFixed(2)}€
|
||||
${weights}${scoringInfo}
|
||||
${weights}${scoringInfo}${contextRules}
|
||||
Verdict algorithmique: ${p.scoring?.decision || "Non calculé"}
|
||||
Justifie ce verdict auprès de l'utilisateur.`;
|
||||
}
|
||||
|
||||
@@ -31,16 +31,18 @@ export interface ProductAnalysisInput {
|
||||
codeFournisseur?: string;
|
||||
totalMagasins?: number;
|
||||
isLastProductOfSupplier?: boolean;
|
||||
/** Résultats du ScoringEngine (optionnel pour l'IA) */
|
||||
/** Scoring metadata */
|
||||
scoring?: {
|
||||
compositeScore: number;
|
||||
decision: string;
|
||||
decision: "A" | "Z";
|
||||
labelProfil: string;
|
||||
isTop30Supplier: boolean;
|
||||
isRecent: boolean;
|
||||
isLastProduct: boolean;
|
||||
threshold: number;
|
||||
};
|
||||
/** Optional context rules for the supplier */
|
||||
supplierContext?: string;
|
||||
}
|
||||
|
||||
export interface AnalysisResult {
|
||||
|
||||
Reference in new issue
Block a user