From 6b4b289177220838b570db1b7de243e1d0962e36 Mon Sep 17 00:00:00 2001 From: desartstudio95 Date: Sat, 16 May 2026 10:49:05 +0200 Subject: [PATCH] feat: Enhance AI analysis and subscription plans Introduce new fields to the analysis response for richer data, including take profit levels, risk-reward ratio, duration, and risk level. This update also expands the Gemini AI's system instructions to incorporate multi-timeframe and long-term analysis capabilities, aiming for more comprehensive market insights. Additionally, new subscription tiers and plan details are added. A new "Experimental" plan is introduced, and existing plans are updated with more specific features and benefits. The admin dashboard is also modified to support these new plan types and their associated logic. --- src/components/AdminDashboard.tsx | 15 +++- src/components/AnalysisView.tsx | 94 +++++++++++++++++-- src/components/PlansView.tsx | 71 +++++++++------ src/services/geminiService.ts | 145 +++++++++++++++++++++--------- src/types.ts | 6 ++ 5 files changed, 254 insertions(+), 77 deletions(-) diff --git a/src/components/AdminDashboard.tsx b/src/components/AdminDashboard.tsx index 04e78b9..077e5c2 100644 --- a/src/components/AdminDashboard.tsx +++ b/src/components/AdminDashboard.tsx @@ -132,11 +132,14 @@ export const AdminDashboard: React.FC = () => { } }; - const handlePlanChange = async (user: any, newPlan: 'basic' | 'pro' | 'elite' | 'lifetime') => { + const handlePlanChange = async (user: any, newPlan: 'basic' | 'experimental' | 'pro' | 'elite' | 'lifetime') => { let limit = 8; let isPremium = false; - if (newPlan === 'pro') { + if (newPlan === 'experimental') { + limit = 3; + isPremium = false; + } else if (newPlan === 'pro') { limit = 15; isPremium = true; } else if (newPlan === 'elite' || newPlan === 'lifetime') { @@ -153,6 +156,11 @@ export const AdminDashboard: React.FC = () => { // Atualiza a validade se mudar o plano if (newPlan === 'lifetime') { updates.subscriptionEndsAt = null; // Lifetime não expira + } else if (newPlan === 'experimental') { + // Experimental dura 14 dias + if (user.isApproved) { + updates.subscriptionEndsAt = Date.now() + 14 * 24 * 60 * 60 * 1000; + } } else { // Se não tinha data de fim e já estava aprovado, define 30 dias a partir de agora if (user.isApproved && !user.subscriptionEndsAt) { @@ -390,9 +398,10 @@ export const AdminDashboard: React.FC = () => {