-- ============================================================================
-- SEED: Products Catalog
-- DESCRIPTION: Catalogo inicial de productos y servicios
-- VERSION: 1.0.0
-- CREATED: 2026-01-10
-- ============================================================================

-- Productos de Predicciones (One-Time)
INSERT INTO products.products (
    sku, name, slug, description, short_description,
    type, category, price, compare_price, currency,
    features, limits,
    ml_model_id, prediction_type, prediction_count,
    image_url, badge, sort_order, is_active, is_vip, is_featured
) VALUES
-- Pack AMD Detector
(
    'PRED-AMD-10',
    'AMD Detector - Pack 10 Predicciones',
    'amd-detector-10',
    'Detecta patrones de Acumulación, Manipulación y Distribución en el mercado. Ideal para identificar movimientos institucionales.',
    '10 predicciones AMD con 85% accuracy histórico',
    'ONE_TIME', 'PREDICTION',
    29.00, 39.00, 'USD',
    '[
        {"name": "10 predicciones AMD", "included": true},
        {"name": "Válido por 30 días", "included": true},
        {"name": "Accuracy histórico 85%", "included": true},
        {"name": "Soporte email", "included": true}
    ]'::JSONB,
    '{"predictions": 10, "validity_days": 30}'::JSONB,
    'amd_detector', 'AMD', 10,
    '/images/products/amd-detector.png',
    'Popular',
    1, TRUE, FALSE, TRUE
),
(
    'PRED-AMD-50',
    'AMD Detector - Pack 50 Predicciones',
    'amd-detector-50',
    'Pack profesional de 50 predicciones AMD. Ahorra 20% comparado con packs individuales.',
    '50 predicciones AMD - Mejor valor',
    'ONE_TIME', 'PREDICTION',
    119.00, 145.00, 'USD',
    '[
        {"name": "50 predicciones AMD", "included": true},
        {"name": "Válido por 60 días", "included": true},
        {"name": "20% descuento", "included": true},
        {"name": "Soporte prioritario", "included": true}
    ]'::JSONB,
    '{"predictions": 50, "validity_days": 60}'::JSONB,
    'amd_detector', 'AMD', 50,
    '/images/products/amd-detector-pro.png',
    'Ahorra 20%',
    2, TRUE, FALSE, FALSE
),
-- Pack Range Predictor
(
    'PRED-RANGE-10',
    'Range Predictor - Pack 10 Predicciones',
    'range-predictor-10',
    'Predice rangos de precio con alta precisión. Perfecto para trading de soporte/resistencia.',
    '10 predicciones de rango de precio',
    'ONE_TIME', 'PREDICTION',
    24.00, 34.00, 'USD',
    '[
        {"name": "10 predicciones de rango", "included": true},
        {"name": "Válido por 30 días", "included": true},
        {"name": "Incluye niveles S/R", "included": true}
    ]'::JSONB,
    '{"predictions": 10, "validity_days": 30}'::JSONB,
    'range_predictor', 'RANGE', 10,
    '/images/products/range-predictor.png',
    NULL,
    3, TRUE, FALSE, FALSE
),
-- Pack TPSL
(
    'PRED-TPSL-20',
    'TP/SL Classifier - Pack 20 Predicciones',
    'tpsl-classifier-20',
    'Clasificador avanzado de Take Profit y Stop Loss óptimos basado en condiciones de mercado.',
    'Optimiza tus exits con ML',
    'ONE_TIME', 'PREDICTION',
    49.00, 59.00, 'USD',
    '[
        {"name": "20 predicciones TP/SL", "included": true},
        {"name": "Válido por 45 días", "included": true},
        {"name": "Risk/Reward optimizado", "included": true}
    ]'::JSONB,
    '{"predictions": 20, "validity_days": 45}'::JSONB,
    'tpsl_classifier', 'TPSL', 20,
    '/images/products/tpsl-classifier.png',
    NULL,
    4, TRUE, FALSE, FALSE
),
-- Pack Combo
(
    'PRED-COMBO-STARTER',
    'Combo Starter - AMD + Range + TPSL',
    'combo-starter',
    'Pack combinado perfecto para empezar. Incluye los 3 modelos básicos.',
    'Todo lo que necesitas para empezar',
    'ONE_TIME', 'PREDICTION',
    79.00, 102.00, 'USD',
    '[
        {"name": "10 predicciones AMD", "included": true},
        {"name": "10 predicciones Range", "included": true},
        {"name": "10 predicciones TPSL", "included": true},
        {"name": "Válido por 30 días", "included": true},
        {"name": "22% descuento", "included": true}
    ]'::JSONB,
    '{"predictions_amd": 10, "predictions_range": 10, "predictions_tpsl": 10, "validity_days": 30}'::JSONB,
    NULL, 'COMBO', 30,
    '/images/products/combo-starter.png',
    'Best Value',
    5, TRUE, FALSE, TRUE
)
ON CONFLICT (sku) DO UPDATE SET
    name = EXCLUDED.name,
    description = EXCLUDED.description,
    price = EXCLUDED.price,
    compare_price = EXCLUDED.compare_price,
    features = EXCLUDED.features,
    limits = EXCLUDED.limits,
    badge = EXCLUDED.badge,
    is_featured = EXCLUDED.is_featured,
    updated_at = NOW();

-- Productos de Acceso a Agentes (Subscription)
INSERT INTO products.products (
    sku, name, slug, description, short_description,
    type, category, price, currency,
    billing_interval, billing_interval_count,
    features, limits, agent_type,
    image_url, badge, sort_order, is_active, is_vip, is_featured
) VALUES
(
    'AGENT-ATLAS-ACCESS',
    'Atlas Agent - Acceso Mensual',
    'atlas-agent-access',
    'Acceso al agente conservador Atlas. Estrategia de bajo riesgo con retornos estables.',
    'Trading conservador automatizado',
    'SUBSCRIPTION', 'AGENT_ACCESS',
    49.00, 'USD',
    'MONTH', 1,
    '[
        {"name": "Acceso completo a Atlas", "included": true},
        {"name": "Estrategia conservadora", "included": true},
        {"name": "Max drawdown 10%", "included": true},
        {"name": "Reportes diarios", "included": true}
    ]'::JSONB,
    '{"max_allocation": 5000, "risk_level": "LOW"}'::JSONB,
    'ATLAS',
    '/images/agents/atlas.png',
    NULL,
    10, TRUE, FALSE, FALSE
),
(
    'AGENT-ORION-ACCESS',
    'Orion Agent - Acceso Mensual',
    'orion-agent-access',
    'Acceso al agente moderado Orion. Balance óptimo entre riesgo y retorno.',
    'Trading balanceado automatizado',
    'SUBSCRIPTION', 'AGENT_ACCESS',
    79.00, 'USD',
    'MONTH', 1,
    '[
        {"name": "Acceso completo a Orion", "included": true},
        {"name": "Estrategia moderada", "included": true},
        {"name": "Max drawdown 20%", "included": true},
        {"name": "Reportes diarios", "included": true},
        {"name": "Alertas en tiempo real", "included": true}
    ]'::JSONB,
    '{"max_allocation": 10000, "risk_level": "MEDIUM"}'::JSONB,
    'ORION',
    '/images/agents/orion.png',
    'Recomendado',
    11, TRUE, FALSE, TRUE
),
(
    'AGENT-NOVA-ACCESS',
    'Nova Agent - Acceso Mensual',
    'nova-agent-access',
    'Acceso al agente agresivo Nova. Máximo potencial de retorno para traders experimentados.',
    'Trading agresivo automatizado',
    'SUBSCRIPTION', 'AGENT_ACCESS',
    129.00, 'USD',
    'MONTH', 1,
    '[
        {"name": "Acceso completo a Nova", "included": true},
        {"name": "Estrategia agresiva", "included": true},
        {"name": "Alto potencial de retorno", "included": true},
        {"name": "Reportes en tiempo real", "included": true},
        {"name": "Soporte prioritario", "included": true}
    ]'::JSONB,
    '{"max_allocation": 25000, "risk_level": "HIGH"}'::JSONB,
    'NOVA',
    '/images/agents/nova.png',
    'Pro',
    12, TRUE, FALSE, FALSE
)
ON CONFLICT (sku) DO UPDATE SET
    name = EXCLUDED.name,
    description = EXCLUDED.description,
    price = EXCLUDED.price,
    features = EXCLUDED.features,
    limits = EXCLUDED.limits,
    badge = EXCLUDED.badge,
    is_featured = EXCLUDED.is_featured,
    updated_at = NOW();

-- Productos Educativos
INSERT INTO products.products (
    sku, name, slug, description, short_description,
    type, category, price, compare_price, currency,
    features, limits,
    image_url, badge, sort_order, is_active, is_vip, is_featured
) VALUES
(
    'EDU-TRADING-101',
    'Trading Fundamentals 101',
    'trading-fundamentals-101',
    'Curso completo de fundamentos de trading. Desde conceptos básicos hasta estrategias avanzadas.',
    'Aprende trading desde cero',
    'ONE_TIME', 'EDUCATION',
    149.00, 199.00, 'USD',
    '[
        {"name": "20+ horas de video", "included": true},
        {"name": "Acceso de por vida", "included": true},
        {"name": "Certificado de completación", "included": true},
        {"name": "Comunidad privada", "included": true}
    ]'::JSONB,
    '{"lifetime_access": true}'::JSONB,
    '/images/courses/trading-101.png',
    NULL,
    20, TRUE, FALSE, FALSE
),
(
    'EDU-ML-TRADING',
    'ML for Trading Masterclass',
    'ml-trading-masterclass',
    'Masterclass avanzado sobre Machine Learning aplicado al trading. Aprende a crear tus propios modelos.',
    'Domina ML para trading',
    'ONE_TIME', 'EDUCATION',
    399.00, 499.00, 'USD',
    '[
        {"name": "40+ horas de contenido", "included": true},
        {"name": "Código fuente incluido", "included": true},
        {"name": "Acceso a datasets", "included": true},
        {"name": "Mentorías grupales", "value": "4 sesiones"},
        {"name": "Acceso de por vida", "included": true}
    ]'::JSONB,
    '{"lifetime_access": true, "mentoring_sessions": 4}'::JSONB,
    '/images/courses/ml-trading.png',
    'Premium',
    21, TRUE, FALSE, TRUE
)
ON CONFLICT (sku) DO UPDATE SET
    name = EXCLUDED.name,
    description = EXCLUDED.description,
    price = EXCLUDED.price,
    compare_price = EXCLUDED.compare_price,
    features = EXCLUDED.features,
    badge = EXCLUDED.badge,
    is_featured = EXCLUDED.is_featured,
    updated_at = NOW();

-- Productos VIP (referencia a tiers)
INSERT INTO products.products (
    sku, name, slug, description, short_description,
    type, category, price, currency,
    billing_interval, billing_interval_count, trial_days,
    features, limits,
    image_url, badge, sort_order, is_active, is_vip, is_featured
) VALUES
(
    'VIP-GOLD-MONTHLY',
    'VIP Gold - Mensual',
    'vip-gold-monthly',
    'Suscripción VIP Gold con acceso a modelos premium',
    'Tier Gold - $199/mes',
    'VIP', 'PREMIUM_FEATURE',
    199.00, 'USD',
    'MONTH', 1, 7,
    '[
        {"name": "Ver todos los beneficios Gold", "included": true}
    ]'::JSONB,
    '{"vip_tier": "GOLD"}'::JSONB,
    '/images/vip/gold.png',
    NULL,
    30, TRUE, TRUE, FALSE
),
(
    'VIP-PLATINUM-MONTHLY',
    'VIP Platinum - Mensual',
    'vip-platinum-monthly',
    'Suscripción VIP Platinum con acceso completo',
    'Tier Platinum - $399/mes',
    'VIP', 'PREMIUM_FEATURE',
    399.00, 'USD',
    'MONTH', 1, 7,
    '[
        {"name": "Ver todos los beneficios Platinum", "included": true}
    ]'::JSONB,
    '{"vip_tier": "PLATINUM"}'::JSONB,
    '/images/vip/platinum.png',
    'Popular',
    31, TRUE, TRUE, TRUE
),
(
    'VIP-DIAMOND-MONTHLY',
    'VIP Diamond - Mensual',
    'vip-diamond-monthly',
    'Suscripción VIP Diamond - Acceso total ilimitado',
    'Tier Diamond - $999/mes',
    'VIP', 'PREMIUM_FEATURE',
    999.00, 'USD',
    'MONTH', 1, 14,
    '[
        {"name": "Ver todos los beneficios Diamond", "included": true}
    ]'::JSONB,
    '{"vip_tier": "DIAMOND"}'::JSONB,
    '/images/vip/diamond.png',
    'Exclusive',
    32, TRUE, TRUE, FALSE
)
ON CONFLICT (sku) DO UPDATE SET
    name = EXCLUDED.name,
    description = EXCLUDED.description,
    price = EXCLUDED.price,
    features = EXCLUDED.features,
    badge = EXCLUDED.badge,
    is_featured = EXCLUDED.is_featured,
    updated_at = NOW();
