This commit is contained in:
g
2026-01-10 02:18:56 +00:00
parent 6c90ba90c3
commit 437aec110c
2 changed files with 22 additions and 1 deletions

View File

@@ -162,9 +162,14 @@ export default function PredictionsChart({
<CardTitle className="flex items-center gap-2">
<BarChart3 className="h-5 w-5" />
Predictions & Forecasting
{predictions.sales.aiModel?.used && (
<Sparkles className="h-4 w-4 text-purple-500" />
)}
</CardTitle>
<CardDescription>
AI-powered predictions for sales, demand, and inventory
{predictions.sales.aiModel?.used
? "AI neural network + statistical models for sales, demand, and inventory"
: "AI-powered predictions for sales, demand, and inventory"}
</CardDescription>
</div>
<div className="flex items-center gap-2">
@@ -242,6 +247,16 @@ export default function PredictionsChart({
</span>
)}
</Badge>
{predictions.sales.aiModel?.used && (
<Badge variant="outline" className="bg-purple-500/10 text-purple-700 dark:text-purple-400 border-purple-500/30">
🤖 AI Powered
{predictions.sales.aiModel.modelAccuracy !== undefined && (
<span className="ml-1 opacity-75">
({Math.round(predictions.sales.aiModel.modelAccuracy * 100)}%)
</span>
)}
</Badge>
)}
{predictions.sales.trend && (
<Badge
variant="outline"

View File

@@ -311,12 +311,18 @@ export interface SalesPrediction {
confidence: "very_high" | "high" | "medium" | "low";
method: string;
methods?: {
aiNeuralNetwork?: number | null;
weightedMovingAverage?: number | null;
exponentialSmoothing?: number | null;
holtWinters?: number | null;
weightedLinearRegression?: number | null;
trendAdjusted?: number | null;
};
aiModel?: {
used: boolean;
confidence?: string;
modelAccuracy?: number;
};
trend?: {
direction: "up" | "down" | "neutral";
strength: number;